Added methods for better handling cascading user deletions and updating group/plugin ownership
Updated test to correspond to recent changes