minor update to use setimmediate, if it's available, or fallback to process.nextTick