Improve version utilities

This will now handle comparison of certain versions correctly (e.g.
1.7.10 against 1.7.2).