Added directories to valid paths for require()

Fix #245 and #240
Modules contained in directories are skipped so just added checking for directory also.
Modules with incorrect main entry points in their *package.json* throws `Error` with code property set to  `'MODULE_NOT_FOUND'`, so IMO it would be better to just ignore incorrect modules.