Add a base class for node visitors (to offer no-op implementations of all members).
Fix variable scope hierarchy.