Add code to compute the rank of the cards.

Not finished yet.