Move code back to db/flask.py

Use callback instead of circular imports, and call it from the main
__init__.py. This way, we don't need to import db.flask everywhere.
Add some Flask-Login code
Use blueprint instead of Classy for users