Commit before refactoring of totality checker.
Control-flow graph and size function mostly done (only constructor functions are missing).