Unittests for reader so far

This is safe to be merged, it improves the reader to cope with the tests -- although there are some tests commented out because the reader is not yet robust enough (and several TODO notes). Also, bad server hellos are missing.