Use events instead of emitter for browserify use