Added writing to PacketStream and began implementation of a protocol.