Minor cleanups in database.py and catching the missing config files.
Creating the data dir if it's missing.