Add optimal team calculation.

Put the current optimal team on both the score and medal views. This
commit also pushes the bulk of the data handling into the model classes.