Support all standard Druid functions in GroupBy and nested groupBy

Uses the test case in #592 (with a minor change of using doubles for post aggs instead of longs).