Style fixes; moved uniqueValues() function to a more appropriate file.
Added missing global; moved delete-specific logic from reSortGroups() to deleteGroup().
Style fixes.