Issue flask sqlalchemy2.0

Adds support for Flask-SQLAlchemy 2.0.
Adds a slave_session attribute to the db object to have global access to a scoped_session for queries to slave DB nodes. db.slave_session will point to db.session if there are no nodes other than master DB node.