ebuild: update pkg version comparison, pep8 fixes

This commit removes the now-unnecessary "compare" function, and changes
perform_cmp to version_cmp, as well as replacing calls to them with
calls to the new function in salt.utils.

Also made a number of pep8 fixes.
apt: update pkg version comparison

This commit removes the now-unnecessary "compare" function, and changes
perform_cmp to version_cmp, as well as replacing calls to them with
calls to the new function in salt.utils.
Fix version specification in pip.installed states

This commit includes one fix and one enhancement:

1. Version specification is more intelligent now, and checks the
   currently-installed version against the desired version or version
   range.

2. Version specification properly overrides upgrade=True (fixes #5270).