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

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os.path
import pkgutil
import re
import sys
from types import ModuleType
from ansible import constants as C
from ansible.module_utils._text import to_bytes, to_native, to_text
from ansible.module_utils.six import iteritems, string_types, with_metaclass
from ansible.utils.singleton import Singleton
try:
    from importlib import import_module
except ImportError:
    import_module = __import__
_SYNTHETIC_PACKAGES = {
    'ansible_collections.ansible': dict(type='pkg_only'),
    'ansible_collections.ansible.builtin': dict(type='pkg_only'),
    'ansible_collections.ansible.builtin.plugins': dict(type='map', map='ansible.plugins'),
    'ansible_collections.ansible.builtin.plugins.module_utils': dict(type='map', map='ansible.module_utils', graft=True),
    'ansible_collections.ansible.builtin.plugins.modules': dict(type='flatmap', flatmap='ansible.modules', graft=True),
}
_collection_qualified_re = re.compile(to_text(r'^(\w+)\.(\w+)\.(\w+)$'))
class AnsibleCollectionLoader(with_metaclass(Singleton, object)):