Support in new parser function features and add parser tests

Support advance SQL queries such as DISTINCT, GROUP BY, ORDER BY, etc.  Also rewrites and tests parser.