Add/rewrite unit tests, fix some doc strings
Change env#error to returns the Error object

env#error was returning Self, and this was misleading other part of
the application in thinking no error had been thrown when an error
listener was set. Now env#error returns the provided error for more
consistency and to allow other part of the system to handle errors.
Clone arguments passed to env#create generators.

Add and refactor lots of related unit tests.
Extract the path resolution logic out of .register. Refactor paths handling in the test/env.js
Merge pull request #380 from SBoudrias/refactor-env

Env refactoring