Better path handling for NPM modules