cleaned up the logic behind serialization.
fixed a bug in list serialization. Note that heavily nested lists wil use much more memory than objects during serialization.
In the process of moving locality from being a part of the data to being part of parsing (reading and writing)