Reusing the event handler call optimization for array of handlers

I noticed that you have an optimization for calling handlers if there are 0 to 2 arguments. But this optimization is not used if there is an array of handlers. Therefore, I moved the optimization code to a separate function. I am assuming that a function call is more efficient than the argument computation (not verified this). If not, an alternative is to flatten this code and remove the callHandler function.