add support for excluding module path extensions from generated modules

@wpoely86: please review
before, you had an if to check this. It's guaranteed that this is not needed anymore?