for node >= v0.10.0 use global.setImmediate for nextTick

Tried to stick with your code style.

In node v0.10.0 you get warnings for very recursive calls to process.nextTick. They say to use globale.setImmediate.