Put small intermediate results from forLoops in temporary variables that are
copied and update large intermediate results in-place.

No functional change. Gives 2-3% better performance on matrix multiplication.
Merge pull request #134 from pjonsson/faster-sum

Put small intermediate results from forLoops in temporary variables