bug fixes for arc_readc
some unit tests for I/O functions
add check_io