Add Pkg2.installed(pkg) method

As a follow-up to #4022, add this convenience method to test if a particular package is installed.
Merge pull request #4029 from mlubin/patch-2

Add Pkg2.installed(pkg) method