Adding tests for ordering by function. Will help closing #32.
Adding order by function on SQLite, PostgreSQL and MySQL adapters (#32).