WIP: More work on finalizing the algorithms.

Various testing pieces of code.
Tweaks to improve robustness of self-consistent.
Import fixes for fully self-consistent.