Split to separate files, a lot of new autobalance and scramble logic.