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

for candidate_name in candidates:
                try:
                    
                    if candidate_name.startswith('ansible.legacy'):
                        
                        p = self._find_plugin_legacy(name.replace('ansible.legacy.', '', 1), ignore_deprecated, check_aliases, suffix)
                    else:
                        p = self._find_fq_plugin(candidate_name, suffix)
                    if p:
                        return p
                except Exception as ex:
                    errors.append(to_native(ex))
            if errors:
                display.debug(msg='plugin lookup for {0} failed; errors: {1}'.format(name, '; '.join(errors)))
            return None
        
        return self._find_plugin_legacy(name, ignore_deprecated, check_aliases, suffix)
    def _find_plugin_legacy(self, name, ignore_deprecated=False, check_aliases=False, suffix=None):
        if check_aliases:
            name = self.aliases.get(name, name)
        
        
        pull_cache = self._plugin_path_cache[suffix]
        try:
            return pull_cache[name]
        except KeyError:
            
            pass