Add #is_primitive? and #generate_typeref