Make checks for generator functions without yield optional

Generators without a yield are valid, making this check too strict.

For example:

    function *() {} // This is useless but valid.

This commit makes the check optional (`noyield` switches the check off), adds a unit test for the new switch, and makes the error for unyielding generators a warning.

References:

Closes #1123