And, here we go. After a bunch of confused swearing and writing more weird helper functions, I've managed to seemingly update the code and the active tests to use the new logic I planned out. The proof of this will be in updating the other tests and seeing how they work, but I ended up realizing something as I was working on this:
These tests are nowhere near thorough enough. I was only getting failures because I was managing to trigger weird errors. I need to update these existing tests to actually make assertions about the shape of the output.
I just improved the tests a little, but I think they need some more work. I'll look into that tomorrow, and then see about updating the other tests to the new API. Hopefully, that will prove things out, given that the tests that need to be rewritten, were a major part of the motivation for the rewrite.
Anyway, it's late and I'm tired. Again.