Refactoring to make Node an interface.

This will be used to support custom non-terminal reductions,
where the user can define a rule that returns anything implementing
the Node interface.