EventEmitter, node & browser compatible implementation