simple test cleanup
test showing failure to detect extraneousness of cyclic peer dev deps in non-dev mode
Add top-level env-triggered debug function
Do not cache forever at the module-level, only per-run
Find extraneous deps properly

This is a fix for all the back-and-forth of marking dev/peer deps
extraneous improperly.  A fix was attempted in c46e5a8, but that caused
a regression where extraneousness was overly broad.

Rather than walk the tree as we go, marking each used dependency as
non-extraneous if it is used, or extraneous if it is not, this takes a
different approach.

Every package is marked as extraneous at first.  Then, after the
dependency tree has been fully resolved, we start at the root node, and
mark each dependency as extraneous=false if it is the satisfaction of
some requirement.  Then we recurse over each dep marked thusly, marking
its dependencies, peerDependencies, and (if opts.dev=true)
devDependencies similarly.

This way, we can detect extraneous cycles of peerDependency sets where
ALL members of the set are extraneous, because NONE of them are
required, while still properly marking them all as required if any of
them are required.