use setImmediate instead of setTimeout for asynchronicity

I think using setImmediate instead of setTimeout is more the node way. It is also less cryptic and maybe the most important point, it is faster. On my computer, launching the tests with setTimeout takes 25ms, and only 12ms with setImmediate.