Fix bytestring slices for compatibility

It turns out I was mistaken, and the print() changes weren't the only ones that needed to be made. This resolves the rest of the problems, and the script will run in Python 3.

In Python 2, b'asdf'[0] returns b'a', but in Python 3, it returns 97, which is
the result of ord(b'a'). In other words, there are a lot of ord() calls that
are now unnecessary for Python 3 but still necessary for Python 2.

This can be resolved by using b'asdf'[0:1], which returns b'a' in both versions.