first stab at switching over to flask-sqlalchemy
refactor finished to use flask-sqlalchemy patterns