instantiate generators fix

There was a null block being incorrectly returned, which was only being picked up when exporting a generator function.

This fixes that issue and includes a test for generator exports.