fix: npm run fails silently. closes #2959

if the missing command is "test", logs a text error, otherwise creates an actual error.
fixed so test always "passes" and doesn't exit
Fix ignore-scripts test
Add unit tests

This is a squashed and rebased version of a PR initially created by @flipside as PR #4546
approved by @isaacs here (https://github.com/npm/npm/pull/4546#issuecomment-42875006)
with unit tests by @thomblake as PR #5814

Now squashed and rebased against current npm/npm#master, all unit tests passing.