Wrap generator in a skulpt function.
Merge pull request #208 from albertjan/generator-func-fix

Wrap generator in a skulpt function.

closes #207