Cache the tally value inside the tally_for: key

This makes classify() scream while making the train() performance
slightly worse. I think it is a fair trade-off.