Use EventEmitter from node core.

Just copied from core, except removing the domain stuff.

What I realy want is `EventEmitter.listenerCount`, but it is just as easy to just update the whole file.