prefer primary email, not first email

was arbitrarily setting email to the first email in the emails array.   now looping through the array and stopping on "primary"