fix semver sorting, add tests