Use sqlalchemy for models.

Since the models are starting to get relational, might as well use sql
with a more mature and full-featured ORM library.