Migrating from heroku MySQL to PostgreSQL

Replaces #113.