Wrote most of the (untested) dynamic query modifier functionality.