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