SQLAlchemy integration

I don't know if it does, but if sqlalchemy has an actual json type, that can be used here. I have it as text in the table definitions because postgresql < 9.2 doesn't support the 'json' or 'jsonb' data types, but it'd be nice to use those where they're available.

If sqlalchemy doesn't have any notion of that, or if it's more convenient to ignore it, keeping it as-is is fine though.