Pulls all the non-handler code into model.py, so we can distribute functionality across main.py and admin.py