Added a Query Manager to prepare and cache prepared statements. Refactoring to support this addition.