allow complex expressions in order by clauses

this is necessary because esp. oracle sometimes requires ordering by eg. aggregation
values (mysql seems to be a bit more tolerant in these cases).

query parser now also accepts "nulls first/last" options in order clauses