Make single DB connection
Implement testing mode and clean up code
Create DB connections in global scope and clean up comments