Factored out db initialization into config.py