The core group membership code.