Reworked NodeVisitor to be more extensible.