Event emitter

Here I try to use the EventEmitter pattern to get out of callback Hell.