error message propagation

threading Ok/Err results through all type checking functions, so
that when an error occurs, can output the partially re-rewritten
program with the TC ERROR message at the right spot in the program.