Moves DBQuery and associates to a new search module.
Revises the sub-queries into a preparation class.
This makes the code a bit easier to read as well as possibly makes things
easier to debug (in the future). Also, we are preloading the templates rather
than reading from file each time.
Fixes the query to only use specified keywords and wildcards.