A trivial way to implement Npm.resolve for #845

This is a fix for #845 to add `require.resolve` to `Npm`. The idea is that sometimes you have to have access to files bundled in npm packages and not import them as node.js modules.

(Updated version of #1188 against current `devel` branch.)