Changed SQLAlchemy sessions and app factories

Now scoped_sessions and application factory work as intended.
I simplified `conftest.py`, and `create_app()`.