flipped `byteAt` to count from the other end

and new doctests.