Host groups consolidation (updated #45)

This is pull request #45 with some fixes on top.