Made changes to serial communication to ensure that a connection is
established before reading and writing packets. Reading also occurs
byte-by-byte now to ensure the full packet is read instead of getting
segmented packets.