Next phase of the reworking

...Needs more shuffling of objects and functions around, but functional
again.