Build: Filter and sort versions in gensite (fixes #1430)

> Do the semver functions work with such strings?

Interestingly, some do, and some don't. `valid` is the latter, so I pushed an amended commit that combines a map and filter step that trims whitespace and converts version strings to x.y.z format.



> In git 2.x you could also sort the tags with the option --sort=version:refname instead.

Is git 2.x prevalent enough yet to assume that it's available? Though since this is only a dev step that's not as big of a deal.