Added algebra for folding CONT tags in the tree

Cont tags can now be folded up into record providing they don't branch
right (which they shouldn't). This transformation is safe even if they
do though, because unmatched nodes aren't touched.