custom sort function for contacts repeater (orders by state and then jid)