Refactor how NPM paths are get

Fix bug where the process walked up every NPM paths for node_modules dir.
Fix #455
Merge pull request #458 from SBoudrias/path-resolution

Refactor how NPM paths are get (Fix #455)