Make NPM work in sub modules

@tfeng wrote a fix for executing npm correctly for sub modules (#16).

This extends that pull request by a test which can be run via "sbt scripted".

If you revert his patch 705bab8, the test fails.