Ongoing refactoring of the scored tree system.

The code still doesn't compile. But we're getting closer...