There was an unfortunate amount of code duplication in the old code,
particularly around the issuing of LSR instruction sequences. Gather
the relevant state into a structure, and split the repeated code into
separate functions.
Also add a bunch of commentary explaining the underlying theory.