add generators version

I have planned a more efficient version later, with Promise.spawn you always create the generator function from scratch.