refactored fixes #2250 to use join table (host_classes, hostgroup_classes) for adding/removing puppetclasses