Adaptive Herbivore Ecology: From Resources to Populations in Variable Environments