Add test to ensure test/production mode is respected
Implement single DB connection scheme