split flask app away from sqlalchemy etc
make flask app restartable/killable cleanly