fix "AttributeError: 'str' object has no attribute 'get'" and happy lint

This addresses an issue uncovered in https://github.com/saltstack/salt/issues/14426#issuecomment-50383774

Rather than return a string with an error message, when the expected return type is something other than a string, raise an exception when python-apt is missing.

Also address a handful of the lint issues that were encountered along the way. The rest will require significant refactoring.