Use new-style exception syntax.
Use new function attribute names.
Use 'in' operator instead of 'has_key' method.
reduce is no longer a global function in Py3.
Fix lambda functions that take tuples.

Python 3 will no longer unpack them into multiple arguments.
Change next calls from methods to keyword.
doc: Replace backticks with repr calls.
Use operator.itemgetter where possible.
Merge pull request #1360 from QuLogic/python3-safe

Python3 "safe" fixes.