Essays on the economics of social networks