Moved all db-related stuff into db.py.