[libcontacts] Name grouper fixes.

Allow grouper to override default set of groups. Ensure
returned group is in the valid list of groups.