Refractored client side.
Seperate classes for server connection, input and output streams.