Reducing the number of calls to queryTranslator
Adding a method to mark a query as dirty, using it to add extra logic
when a query internal state is altered
Coding standards fixups.