events: attempt to speed the crap up

There is some very hot code in here that needs some cleanup from the
horrors of javascript slowness. Changes include:

* Simplify logic checks, and use faster ones where appropriate.
* Ability to return just the length of listeners for a given type, using
  _listenerLength(). Needing to check, slice return then check again was
  way too much overhead for such a simple task.