Fixed to work in Python 3.3+

Forgot the changes required from moving from Python 2.6.7 to 3.4.1
(heartbleed changes) require parens around print calls and range
replacing xrange.