Labour's choice of a deputy leader is the culmination of a momentous struggle for the party's future.