Check versions of installed packages
Refactor has_package test for simpler version matching