Improvements to the deserializer.
Some helpers and improvements to IO.
Cleanup.