cleanup for events

1) util.isObject -> Array.isArray;
2) remove unnecessary length var
3) util.isUndefined -> handler == null
null is better than undefined, it tells you that this is supposed to be so, not just a invalid assign
4) this._maxListeners = this._maxListeners || undefined;
this._maxListeners will be undefined if previous value was 0