The Evolution of Collective Intelligence in Animals