Switch to using print function (for Python 3) using 2to3

Updated main code using the 2to3 print fixer:

$ 2to3 -w -n --no-diffs -f print graphs.py
RefactoringTool: Refactored graphs.py
RefactoringTool: Files that were modified:
RefactoringTool: graphs.py

Also updated the docstrings the same way:

$ 2to3 -w -n --no-diffs -f print -d graphs.py
RefactoringTool: Refactored graphs.py
RefactoringTool: Files that were modified:
RefactoringTool: graphs.py

Manually added the future import line so we can use the
print function under Python 2.6 and 2.7 as well.
Tweak printing to work under Python 2.5 (and in theory 2.4)
For Python 3, no longer need to use 2to3 print fixer, or fix doctests

The remaining changes by 2to3 are trivial (e.g. wrapping iterators like
the range function with a list call), and could be handled in a single
codebase for both Python 2 and 3, with one exception: As long as we
continue to support Python 2.4 and 2.5 we cannot use the Python 3 style
exception catching available in Python 2.6 onwards.