Made tab moving work correctly when adding/removing groups

Previously new groups were not added to sort order, and deleted groups were not removed from sort order.  Now it seems to be working properly with adding and removing groups.