Converted the make_ctests script to C (based on a patch by Royce