Change commonjs module detection

For a file to be identified as a module it has to contain at least one
of the following:
  - commonjs 'require' calls
  - a 'module.exports' statement

Additionally, the processor only checks files contained in the
'module_path' configuration.