Moved PostgreSQL session stuff into postgres-db.js module.