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