Refactored serializing.
Progress. I guess.