Implemented connect and disconnect code

Also fixed an issue with the listener thread exiting immediately because
the exit condition was wrong.
Started work on an endian binary reader

The endian binary reader is aware of the endianness of the stream and
will automatically convert data read from it.
Implemented the endian binary reader
Added a endian binary writer

The endian binary writer automatically converts values to little and big
endian if they need to be before writing them to the stream.