Multi-group biodiversity theory and an application to multi-species maximum sustainable yield