refactor to catch edge cases, remove repeated code

- Move all the supported YAML file extensions into a constant
- Use helper functions to avoid duplicate code for group/host vars
- Catch and disallow some confusing situations, such as the presence of
  multiple group/host vars files for the same group/host, but with
  different extensions.  For example having both group_vars/all.yml and
  group_vars/all.yaml.
- Catch and report file system permission issues, symlink errors,
  unexpected file system objects
- Trivial performance improvement from making fewer stat system calls
- Restructuring that makes it easy for a following patch to support
  directory recursion
Allow organizing host/group vars in a directory

So instead of having:
 group_vars/production.yml

A user could chose to reorganize to:
 group_vars/production/staff.yml
 group_vars/production/networks.yml
 group_vars/production/dns.yml

(Backwards compatible.)
Merge pull request #4758 from alanfairless/group-host-var-dirs

Support organizing group and host variables across multiple files in a directory