Using built-in reflection mechanisms instead of goofy serialization tricks
Refactored code for simplicity
Fixed sub-class handling
Factored out some of the type parsing logic