Improves database api and adds an order by function

Now has support for chained commands that parse correctly as mysql syntax