The core code to support groups.