Added checks for both rule and group dependencies before deleting a group. These are reported to the user and the user can't delete.
Added checks for group dependencies and profile references before deleting a rule (a rule dependency check was already there). The user can't delete the rule if such references exist.
Fix for bug 3028624.