!WIP [rules] Rewrite the linking rules to use "stages", a complex system that allows link steps to be swapped out, reordered and removed without having to fix all their dependencies.