Use local variables to make methods parse easier.

* Stash local variables, and use them inline (seems to be easier to read to me).
* Do not require function prototype extensions (`Function.prototype.on` was used before).