Implement initial support for generating type ids on serialization