Full refactor for using Flask Factories in PyBossa

This is the first big commit doing a big refactor for using Flask Factories.

Basically, every module like Sentinel, Signer, etc. are loaded as classes in
the module pybossa.extensions following the Flask pattern of extensions.

This allows us to load the objects in pybossa.core and configure it lately
whenever we want, allowing us to have more flexibility.

Additionally this commit simplifies a lot pybossa.web as we have now a very
clean run.py file that runs a PyBossa server.

Finally, all the tests are going to be refactor to address the new factory
setup.

This issue will have more commits as there is work to be done on upgrading the
tests.
Use the new factories for testing
Use the new sentinel object
Import sentinel properly
Rebuild db
Refactor
Rollback db session when an exception occurs
Rollback session only for SQLAlchemy exceptions.
Refactor tests
Refactor tests.

NOTE: this commit has refactor also the way we interact with the db object, as
Flask-SQLAlchemy closes the session after a request has been done, so if you
use something like app = db.session.query(App).first and you do after that
a proper Flask request, the object will not be bound to the session anymore.
Refactor
Refactor
Refactor
Refactor
Remove db as it is not used.
Refactor
Refactor
Refactor
Refactor

Import flask_app to configure Sentinel object, otherwise it will fail
Import better the Test case