Add unit test for IO routines.