Implement orderBy [rand] expression

Tested with Sqlite and Postgresql backends.