Python 3 support (without 2to3 build step)

This supersedes PR #2, but does require Python 2.7 or later.

It's been pointed out to me that the format strings for `struct` can be byte strings. Using that would make the code somewhat neater, but I'm [waiting for confirmation](http://bugs.python.org/issue16349) as to whether it's safe to rely on that feature.

I've checked tests and the demo against Python 2.7 and 3.2. Test coverage is now reported as 49% of statements.