Use a global SessionMaker and per-request sessions

This fixes the following error caused by a race inside SQLAlchemy when using different session
makers:

    AttributeError: 'NoneType' object has no attribute 'twophase'

We also merge phantomsql code inside Phantom, since the code is very
small and the added abstraction layer makes it more complicated to
understand.