Changed how data is being serialized and saved. Fixes a data consistency
problem that occured when a data is being received in large bursts of
packets.