Start converting QTemplate to SQLAlchemy and add basic tests