Start cleaning up the canned diagonalization code.