Encapsulate rules and long derivations for each node type in a separate class.

The ultimate goal here is to make it easier to add new node types to the
CFG without having to change several different files
use each node as a class, rather than an instance, to ensure uniqueness
fix some missing derivations
Add support for a new function, "initial substring" and clean up ClueTree printing
Add new "final substring" node.