Postgresql migration complete

Finished up all the postgresql implementation. Now testing against
heroku.