Allow multiple AGGREGATEs + flatten GROUPBYs

Reviewers: marcua, meelap

Reviewed By: meelap

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