Restructured tests. Added test for IOStream connect and read_bytes.