Support continuable style API invocation.
Fix typo and clean whitespace
Remove dependence on setImmediate.