Mostly working code, removing some bugs in the decomposition. Some
formatting cleanup after discovering how badly conventions were being
abused.