Fixed all socket I/O to use DataInputStream/DataOutputStream to
read/write objects as JSON strings