Update getModulePaths.js

regular expression evaluation on Win 7 x64 was causing hang, as described in #96.  Fixed to use path.dirname function to provide the same functionality, and hang is averted.