Invert the meaning of the "dev" option to correct value

The 1.0 style dev flag is incorrectly designed.  Any time a boolean
means "yes, do the thing", that should be the "true" option. In this
case, the flag is "dev", so "dev:true" should mean, "Yes, include dev
dependencies".

However, it was set as "dev:true" meaning "Yes, don't include the dev
dependencies", which is an awkward "no means yes" kind of situation.

I think that @davglass was trying to do the prudent thing and disrupt
the current behavior as little as possible, so that a default "falsey"
choice would do what it currently does, and not treat devDependencies as
extraneous.  I had misread his original pull request, and approved it.

It's unfortunate that this means yet another breaking change.
Thankfully, that's what the Major version in SemVer is for, and not many
libraries use this, apart from npm itself :)
Use util-extend module
Negative depth should be 0, not Infinity
v2.0.0
Correctly set the extraneous flag on dependencies.

The readInstalled_ function sets extraneous=true for every dependency not
required by its direct parent and leaves it to undefined for others.

After the dependency tree has been built, the markExtraneous function will
walk it depth-first and set extraneous=false on dependencies that are not
extraneous and then recurse until all dependencies have been flagged:

for d in dependencies:
  if d.parent is not extraneous:
    set d.extraneous = false
    execute recursively on d.dependencies

This will ensure that extraneous dependencies will not be marked as
extraneous=false incorrectly because of a dependency cycle.