Advanced JavaScript event emitter, allows bubbling and namespaced events