Caste and Ecology in the Social Insects