Unit tests + store the history of the score components in stats

This addresses issue #35 and can help us investigate the complaint by Tom that his score is stuck at 2.