add index.js to file path if module path refer to a folder

pure-cjs failed to find modules under module_dir/index.js
if required as require('module_dir')