separate pubsub file into h and cpp. added mongo_initializer for mongod