Move semver out of libextra.

Done as a part of #8784.