Sql alchemy

There's some git cleaning to be done here, but I don't want to hold up progress.