Issue #1: Fix Python 3.x compatibility

Python 3.x does things a little differently to Python 2.x. Most
of the changes are bytes vs string fixes. Also includes a fix
for the next iterator. I've tested it quickly on Python 2.7 and
Python 3.2 and it seems to work on both now.

Thanks Dan for reporting this issue!