Complete redesign using sqlalchemy and a sqlite database