Use 'in' for key lookup and checking instead of dict.keys() and dict.has_key()