Add Pkg2.installed(pkg) method

As a follow-up to #4022, add this convenience method to test if a particular package is installed.

@StefanKarpinski