Python 3 support

I fixed issue #43 so it works with both Python 2 and 3 (2.7 and 3.4 at least as those were the ones I had installed).