Wrote and ran the first batch of tests.

The first test batch found a bug in public read to character buffer
method, where it returned the EOF character in the buffer and counted it
as a read character. This has been fixed.