Move all the production code into consdiff.{h,c}