Use PostgreSQL as a data store

Design decission: MongoDB doesn't fully satisfy our needs.