fix param names in compare()
remove unneeded debug logging
downgrade when appropriate
add operator checking for version specification
Allow versions to be specified in "pkgs"

This implements #3278. It also properly enforces specified versions in
pkg.installed states, whether you are installing a single package or
many packages.
Merge pull request #3517 from archtaku/issue3278

Allow versions to be specified in "pkgs"