Implementing new spec for TypedObjects: primitives and StructType