clean up the startup: settings.py for import, and db engine creation
upgraded db layer to better support tests