Sorting in Experiments with Application to Social Preferences