camp: Start writing a term-tree parser.

And also fix a machine test and do a little cleanup.