##### 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

ns_path_add = ns.rsplit('.', 1)[-1]
        return os.path.join(path, ns_path_add)
    def get_data(self, filename):
        with open(filename, 'rb') as fd:
            return fd.read()
class AnsibleFlatMapLoader(object):
    _extension_blacklist = ['.pyc', '.pyo']
    def __init__(self, root_package):
        self._root_package = root_package
        self._dirtree = None
    def _init_dirtree(self):
        
        root_path = os.path.dirname(self._root_package.__file__)
        flat_files = []
        
        
        
        for root, dirs, files in os.walk(root_path):
            
            flat_files.extend(((root, f) for f in files if not any((f.endswith(ext) for ext in self._extension_blacklist))))
        self._dirtree = flat_files
    def find_file(self, filename):