The serialization code is now using macros to simplify each line, and to prevent errors. It should be noted that, apart from the region content, the serialization and deserialization code is essentially identical.
I really hope the serialization code still works.