Moved DataEncoder into DataPacket and added some exceptions