npm-packages: Added support for optionalDependencies.
npm-packages linter:

* Avoid sync fs method
* Allow node_modules to be missing if no dependencies are listed
* Complain if node_modules is not a directory (or a symlink to a directory)
npm-packages linter: Fixed typo.
npm-packages: Output an error if the same dependency is listed more than once in different sections.
npm-packages: Added tests for missing packages, and don't fail if a missing package is listed under optionalDependencies.
npm-modules: Remove duplication in tests.