Move ModelBase.session to ModelBase.object_session and add ModelBase.session as proxy to ModelBase.query.session.