add support for excluding module path extensions from generated modules

@wpoely86: please review
when there are no `$MODULEPATH` extensions, `modpath_exts` should be an empty list, which will basically make everything below a no-op (except for the log message)