Fix inventory for test_dir_inventory

It came up that fixing this unit test may relate to another ticket that is open. This work allows us to uncomment this unit test by fixing how we pars variables allowing a quoted variable to contain a '#'.

Work also went into cleaning up some of the test data to clarify what was working.

Lastly work went into cleaning up formatting so that the code is easily read.
Break this out into a reusable function and document regex shortcomings.
add test same host in different files in dir

tests issue #5749
 same host defined in different groups which in turn are defined
 in different ini files in an inventory directory

Conflicts:
	test/units/TestInventory.py
modifed test to use get_hosts instead of get_groups

closes #5749

Conflicts:
	test/units/TestInventory.py
Minor cleanup.
Merge pull request #6287 from risaacson/fix_hash_in_var

Fix inventory for test_dir_inventory, merge PRs from GH-5749, cleanup some formatting.