use setImmediate when available
Merge pull request #4 from nathan7/set-immediate

use setImmediate when available