Started adding code for migrating SQL queries to SQLAlchemy.