Social feedback and the emergence of rank in animal society