SQLAlchemy integration

The fact that this needs a deliberate commit suggests that, like psycopg2, sqlalchemy defaults to "in a transaction" to start. So other than ensuring there's commits after anything that needs it (which it looks like you've done) we shouldn't need to do anything fancy to get proper transactions.