add get all groups

Modified the test, and added an additional test to deal with cursors linked to deleted groups.