Detects if `package-refresh-content` is necessary.

Also added `try-package-exists-p` and cleaned up a bit.