version: utility function to check new version numbers.

This is a suprisingly complicated business, but this seems to do it.
Also adds (unexported) utility functions computations with versions.