Make generators used a boxed return value.

Now the generator returns `{value: any, done: boolean}`. Instead of throwing a
StopIteration when it is done you can check the done property of the return
value.

Generator close has also been removed (it was agreed on es-discuss that we do
not need this in ES).