Extractive foraging and the evolution of primate intelligence