##### SUMMARY
The collection loader currently imports a number of things from Ansible, the heaviest of which is config/constants. This makes it heavyweight and somewhat dangerous for ansible-test and unit tests to use. Refactor it to minimize those imports and supply the necessary impls another way (constructor, DI pattern, etc).

##### ISSUE TYPE
- Feature Idea

##### COMPONENT NAME
AnsibleCollectionLoader

##### ADDITIONAL INFORMATION

if not os.path.isfile(source_path):
                        continue
                    with open(source_path, 'rb') as fd:
                        source = fd.read()
                    code_object = compile(source=source, filename=source_path, mode='exec', flags=0, dont_inherit=True)
                    location = source_path
                    is_package = source_path.endswith('__init__.py')
                    break
                if not location:
                    continue
            newmod = ModuleType(fullname)
            newmod.__file__ = location
            newmod.__loader__ = self
            if is_package:
                if sub_collection:  
                    newmod.__path__ = [candidate_child_path]
                else:
                    newmod.__path__ = package_paths
                newmod.__package__ = fullname
            else:
                newmod.__package__ = parent_pkg_name
            sys.modules[fullname] = newmod
            if code_object:
                
                exec(code_object, newmod.__dict__)
            return newmod
        
        raise ImportError('module {0} not found'.format(fullname))
    @staticmethod
    def _extend_path_with_ns(path, ns):