Python 3 support

Following discussion on PR #32, this adds Python 3 support without any external dependencies. Python 2.6 and above and Python 3.3 and above should work; older versions will not.

The tests are passing on Python 2 and 3; I haven't tried the examples.
RuntimeException isn't a thing, the code was just plain wrong. I use an editor that highlights simple mistakes like undefined names, so I see things like this and just fix them.