Split doc groups so that only entities with the same name and kind are together.