Rewrite to use Flask + SQLAlchemy

Backing storage is now sqlite with ORM instead of an ad-hoc JSON file.

Go with Python 2 instead of 3 mostly because PIL is 2-only and is going
to be necessary further down the road.