Clean up z-term.c and z-term.h