Removed invertDeep
GREEN-feature complete initial PR. The code seems to work as advertised
but needs more testing. I've avoided tests that mess with the file
system or the module cache (which would more completely test the
environment variables system), but the underlying helper functions are
well covered.

I'm not attached to function names etc., so let me know if you want
changes.

Also, I've tried tried to copy the doc comments style, but am glad to
make adjustments.