Fix bytestring slices for compatibility

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.