(WIP) Immutable headnodes

This is probably worth looking at now; there's still some work to do, but it's roughly the shape I'm shooting for.
@pjd-nu, as per the comment, this was just copy/pasted from haas.headnode, so I could delete  the stale module. It's not really worth reviewing in detail until someone gets around to trying to make it work.