Fix for modules being unit tested in a module environment

Improved getModuleProviding() to deal better with classes not originating from a ModuleClassLoader.