SQL parsing & generating fixes, objectstore test fixes

Fix objectstore tests, which required:
1. Fix parsing of SQL queries to handle aliases for functions used in ORDER BY
2. Parse parts of an SQL query in the correct order
3. Fixes for query functions in ORDER BY in SqlGenerator

Also added ant task to run and IQL query so logs can be inspected.

    In mine/dbmodel
    > ant run-iql-query -Dquery='some IQL'