Implement final score

Work in progress for #37. Includes a refactoring of the GTP stuff to allow for easier testing.