Some general code clean-ups

Some general code clean-ups along the lines of MathRobin's.

You may want to look at the change to lib/monitor.js - it's running fine as a local variable, and the p variable would have been overwritten by creating multiple Pollers anyway (allowing previous ones to be garbage collected if it were possible), but I'm not really sure what's preventing it from being garbage collected. You probably have much better insight.