Refactor env.register logic

env.register now only accept the generator path as a String. This force
the generator.resolved behavior to be consistent. At the same time,
removed any check for `generator.raw`; this is an unexpected side effect
and obfuscate the code for very little gain.

Added env.registerStub method to allow adding stub generators as
function to the environment. A check is made on the function passed
to force stubbed generators to extend Base (this is done automatically).

Some test mechanics needed to be fixed in order to pass. This shouldn't
have changed the test logic.