Make PkgVersion more efficient; pass code snippet as argument

Performs all checks once, up front, and passes the $VERSION code snippet as an
argument, to facilitate easier subclassing.