Add support for GROUP BY ROLLUP/CUBE

Implementation status: Greater Hack.