[minor] Clean up planner.
JsExprPhase now returns `Expr => Expr`.

First step toward parameterizing JS so we don’t rely on everything being
in the `this` parameter all the time, which is nasty and dangerous.
Parameterize rest of JS and eliminate `this` abuse

The JS functions for `[Flat]MapOps` now take two parameters instead of
relying on `this` for one of them. That change required parameterizing
all of the JS generation to take a context, rather than relying on it
always being `this`. It should also make it easier to do better
coalescing in the future, without needing a new anonymous function in
order to get a fresh `this`.