Fixes #8551 - use most specific matcher for inherited hostgroups

Host recieves correct smart_class_parameter value when multiple overrides for
inherited host groups exist for parameter.
Fixes #8416 - Fix Puppet classes form n+1 queries
fixes #8592 - allow plug-ins to modify multiple hosts actions

Refactoring patern: Extract method.
fixes #8590 - handle missing 'config' when listing vSphere VMs
fixes #8591 - explicitly set where to subnets.id
fixes #8477 - usability improvements to template locking/defaults
refs #8477 - fix string interpolation and spelling