Simplify SQL
As a next cleanup step, I'd like to sort out the SQL stuff and make it nice and clean.
I came across this library which could be good: ~https://github.com/shadowhand/latitude~ ~Edit: https://github.com/doctrine/dbal~ Edit2: https://github.com/gabordemooij/redbean
@dmorley Take a look and let me know