support generator
change nextTick to setImmediate
Merge pull request #5 from leoner/generator

Generator