Code Hygiene: remove deprecated code

pep8 reports two deprecated python constructs:

    W601 .has_key() is deprecated, use 'in'
    W603 '<>' is deprecated, use '!='

The .has_key() changes probably need to be carefully reviewed.