Effects of Heterogeneity and Homophily on Cooperation. (December 2015)