Cleaned up xprintf.c and added better testing.