cleaned up comments and spacing in database class
removed unused private function
better name for running select queries
more cleanup of db code
deprecate unused function
stop running trim when escaping strings
moves database verification code into db class
removed some globals
cleaned up some private db functions
changed method name to assertInstalled
added @throws to all methods that can throw an exception (in some cases the exception comes from deeper in the object)
cleaned up delayed query code
query cache no longer a global
Merge pull request #5429 from cash/db_cleanup

Db cleanup