Refactored dbManager to use sql procedures to handle inserts and to use the latest schema