Move db module into its own folder
Extract out the database adapter
Move utility functions into their own file
Add new model class