Added reading and writing events to mongo.