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 ints 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.
In addition, a redundant stack size check for the dummy element is
removed.