Fix setTimeout calls

Right now the code is calling setTimeout(callback(...), 0) which is the
same as setTimeout(undefined, 0). The setTimeout is critical because
control flow code assumes that the callbacks won't fire until all the
code in the loop is finished.
Merge pull request #1 from kensnyder/master

Fix setTimeout calls - factory functions and wrapping the internal functions to avoid instant execution.  Given that we were expecting timeout => 0 we didn't notice that it was actually just doing instant execution.  Note: revisit tests and confirm that things are jailed/scope properly to now run actually in the next event loop.