Add initial query rewriting.

This enables use of indices, if they exists, on cross joins when WHERE
filtering is a compound expression consisting of logical ANDs of the
simple detected index triggering cases.

Updates #39.