Add error checking to read and write
Make error codes unique for each failure point
Rename server test to be more descriptive
Add text output to test programs
Null-terminate the buffer at size read