Add pkg_type() for determining the type of a package