Currently during the first phase of multisig, we calculate a variety
of indices and counts that then get mutated later on in
various loops, in a rather hodge-podge fashion.
This Diff changes the values calculated up front to be all const, with better
variable names, and then the mutated variables for each loop are initialized
adjacent to the loops in question. This makes it easier to logically
consider each loop in isolation.