guard against undefined globals, export setImmediate

I'm planning on depending directly on this module for the latest browserify v3 release but the node 0.10 APIs export `setImmediate` and sometimes, particularly for testing, environments won't have {set,clear}{Timeout,Interval} defined.