Cheater Detection is Modified by Social Rank: The Impact of Dominance on the Evolution of Cognitive Functions