Fix Error handling for generator

A generator raising an exception will now correctly emit an `error` event.
This can be used in unit test as the error event is now binded between the generator and its run context. 
Create the error you're going to throw before hand. (`var error = new Error()`)

Then throw it, and test that you receive the same error object. Testing for the name is pretty generic and could be misleading.