Add attachmentgroups property only if groups found
Make local function private
Do not save old preference keys with empty values