Currently working on the tests, spotted some weird bug, turns out typescript wasn't catching it because strict mode isn't on. Turning on strict mode shows all sorts of potential bugs, so that's for later to fix.