Fix #501: Imported test generators are treated as simple test functions

The issue is that `transplant_func()` did not preserve function
generators correctly.  It would wrap the transplanted function with a
decorator, and since no yield statement was present in the decorator,
we'd lose sight of whether the transplanted function was a generator
function.

To fix this, let's check whether the function is a generator function,
and if so, use a for/yield loop to pass the results back using a
generator causing the decorator function to be seen as a generator
function.  This will preserve the fact that the supplied function was a
generator function.