add get all groups

With the case of no cursor supplied (`cursor = None`), and no groups in the contact store, the line `cursor = cursor or group_list[0].key` will fail because `group_list[0]` does not exist.