nir: Misc clean-ups; mostly CF-related
A bunch of these patches are pulled from !623 (closed); some are new. The last patch is my take on a patch @cwabbott0 wrote for !623 (closed) but I think mine is a bit better because it fixes the bug while allowing us to continue re-using helpers better.