Initial query rewrite support.

Currently supports matching columns, literals and count(*) in the selection
and columns in grouping.


Returning a nested Option is pretty confusing.  `Some(None)`??  What does that even mean?