In i/j loop, pull out terms depending only on i. 20% speedup.
Refactor to move loops into a Matrix class. 5% speedup.

This interface is a bit less intuitive for Scorer code, but should allow for
significant savings by more efficient Matrix implementations.
WIP: do clever stuff in matrix
Remove getClass() calls from hot equals() paths. 13% speedup. Shame, shame.