Continuation of refactoring.  Now should (almost) be sufficient code to
operate rubik logic machine.