scoped session factory

Rather than creating a new session / connection in every place that it is required use a scoped session factory (scoped to the thread) to manage connections as described here: http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html?highlight=session#using-thread-local-scope-with-web-applications

@dannyroberts @esoergel @czue 
I was wondering if this would raise the same exception.  I just tested this out:

    >>> try:
    ...     raise AssertionError()
    ... except:
    ...     raise
    Traceback (most recent call last):
    File "<input>", line 2, in <module>
    AssertionError
    >>> try:
    ...     raise AssertionError()
    ... except Exception as e:
    ...     raise e
    Traceback (most recent call last):
    File "<input>", line 4, in <module>
    AssertionError

Looks like it does, I didn't know about that.  Just found [this](https://wiki.python.org/moin/HandlingExceptions): "By using raise with no arguments, you will re-raise the last exception. A common place to use this would be to roll back a transaction, or undo operations."
#themoreyouknow