Refactor ttr.players to tidy up state management.

Factor all the state manipulation out into concise functions that
do one thing.

Refers #1