Fix #2579: Query Builder's "no escape" functionality didn't work properly with query cache
Fix #2237: Parser library failed if the same tag pair is used more than once within a template

(manually applying PR #2238 + updated unit tests)