process.nextTick shim for node.js and the browser