Fix export when group sets don't have unique names

When generating the list of group sets, we store the group sets in
mapping with group set name to group set object. If there are two group
sets with the same name, one of them will overwrite the other. This
causes problems when later groups belonging to the other group set tries
to look for its group set. Fixed by changing the mapping to use group
set ID for the key instead of group set name.