Rewrite OutputPlans, they're a mess
We can do this after V5 goes live, but with the new system of unaries and flags, the OutputPlan logic should be revised fully. In #2118 I rewrote from the eval'd JS to TS, but the resulting TS is an absolute mess because the eval'd code worked in a way that only eval'd JS could, so now we're passing many many things all around. In #2114 we then addressed the new way of checking for errors related to the output plan even if the bucket doesn't exist at runtime. There's also inefficiencies where we're checking the same things twice in different locations, and potentially there's also the risk of places where we don't check certain things at all. The aim should be that everything has a nice simple and straightforward flow, but right now the code reeks of layers upon layers of modification without a full refactor. But, due to the push to get V5 out, I'm going to have to delay this refactoring work.