Use single function to calculate changeset state/review state
Created by: mrnugget
This fixes #9101 by introducing a single function, used by CalcCounts
(the burndown chart) and ComputeReviewState
/ComputeState
(used to calculate the state/review-state of a single changeset).
As described in #9101 we previously ran into a lot of errors due to these two parts of the codebase — burndown chart and the calculation of state for a single changeset — using different ways to derive state from a changeset and its events.
Now we have a single function for this.