MongoDB replaced with Postgres; fully functional rewrite.