cleanup for events

1) util.isObject -> Array.isArray;
2) -1 loop when .emit has 3+ arguments and many handlers
3) remove unnecessary length var
4) util.isUndefined -> handler == null
If `n` has been checked to be a positive number, there's no need to coerce it to one.