Give DB Session safer semantics.

The default behaviour of SQLAlchemy sessions is to open a transaction
as soon as a session is accessed. This leads to a situation where any
access outside a block that explicitly closes a transaction can leave
a dangling connection, eventually consuming all available connections.

The new semantics are that a session can only be acquired as a context
manager, opening a new transaction and closing it automatically.
Access, including queries, outside a context will raise an exception.