Name.Component: For JavaScript, added toVersion and toSegment.