Refactor ttr.cards for better state management.

Instead of multiple functions all modifying state, now there is one
function that performs a single kind of state modification against a
deck.

Refers #1