fix deps & deprecated imports
ensure '_model_changes' is set on session to please Flask-Sqlalchemy <= 1.0