Improve CommitOrderCalculator and tests