Refactor env.register logic (Fix #353)

`env.register` now only accept the generator path as a String. This force
the `generator.resolved` behaviour 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 tests logic.

-----------

The motivation behind this change is explained in #353. Basically it's a follow up after the 1.0 release bug to update what felt to me like an error prone logic and to make sure `generator.resolved` value was consistent no matter what.