Migrate to using Flask-SQLAlchemy over self-rolled setup.