Add query rewrite support for where, group by and nested expressions.

Hmm..... failing to think of too many cases where rollups with no group by's would be useful....