Revert "Working on serialization."

This reverts commit 2d39942fec803d93720d7830461d6970de250350.
Revert "Revert "Working on serialization.""

This reverts commit 01536b11ffb9b1a95f4b87cd4f3b6235acffc025.
Fixed serialization in typed.hpp.
Streaming distinct works.