Refactored backend query handling to allow independent query handlers.
Backend only resets (clears caches) when requested or DB domain name changes.
Better hash keys for caching, to avoid duplicates.
The backend primes its caches by submitting queries to itself.

This change isn't particularly useful by itself since the backend still has to wait for the priming to finish before finishing a request.
Backend uses background thread to watch for settings changes and do cache priming.