Re-writing the Type system to support dump and load for persistence.

Also added a 'Serialized' type to test the new changes.