Before, the apply method was one big 400-line chunk. This just splits it
up into more manageable chunks by introducing a ``_NodeUpdater`` auxiliary
class holding logic for updating various types of references.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>