Did a big pile of refactoring in preparation for the next chunk of new functionality I want to add. I'm going to need to rewrite all of that again later, but I don't have the time right now to jump straight to what the implementation is going to be at release as that's a lot of additional work mostly unrelated to my current train of thought and I'd rather get the thing I'm working on up and running so I can make sure that's working properly while the relevant details are still in my head.