progress! the big refactoring is done and all the tests are passing again. I already added a whole bunch of features in the process, but they still need thorough testing. there's still a lot to do, but the main chunk of structural work is out of the way.