Part of fix for #5551. Split out the group enumeration functions to a BUILTIN and...