Allow multiple AGGREGATES + flatten GROUPBYs

Differential Revision: http://phabricator.locu.com/D3179
bf
bf