Collective knowledge and the dynamics of culture in chimpanzees