Friendship, Cliquishness, and the Emergence of Cooperation