Rework version comparison to be more user-friendly

This commit touches a lot of files, but almost all of them refer back to
the common code written in pkg_resource.py.