Move db & session to database.py.
Update frontend to work with new database models.