Fixed deprecation for node 0.10

Use `setImmediate` instead of `process.nextTick`.  This removes deprecation warnings in console.

Also fixes problem where the node process can crash with a stack overflow because it emits too many deprecation warnings too fast for itself to cope with.