events: add check for listeners length

Ability to return just the length of listeners for a given type, using
_listenerLength(). This will be a lot cheaper than creating a copy of
the listeners array just to check it's length.