Hacking at all the things.. none of this is in a working state, rethinking whether this is worth rewriting