Collapsing mostly works. Issue with drawing edges
We eliminate edges between two collapsed nodes
Some changes so that the function that converts a node to an output can now refer to the nodes around it