Massive refactoring of the unittest structure for serialization formats.