Add python2 support

The part I'm less confident in is that it swaps `int.from_bytes` out for `ord`, as `from_bytes` is a new python3 thing.

Could this have non-obvious implications? With `int.from_bytes` you get to pick the byteorder, but that shouldn't have any effect since it's used on exactly one byte from `urandom`.