Added postgres gem and adapted database.