Redo the way we use SQLAlchemy, hopefully to stop tests trashing the live DB. Still not quite right.