pk: Rework local resource to allow uninstalling and upgrading
Removing: Prior to this change clicking "Remove" would instead try to install the package, and fail because it's already installed.
Upgrading: Prior to this change discover would only offer to install a different version of the same package if it provided new files.