Major Fixes to Query Cacheing.

Requires Lift.