Use setTimeout instead of setImmediate

This module should be able to be used in a browser with a CommonJS
loader like Browserify, and setImmediate is not available in many
browsers.