Made UTF-8 decoding take advantage of self-synchronization.

The UTF-8 encoding has the nice property that, no matter where in a
byte stream you start, it is easy to scan backwards or forwards to the
beginning of a character. This change takes advantage of this fact and
splits the incoming byte string by scanning from the end and splitting
the string just behind the last full character. The previous
implementation scanned from the beginning and therefore typically had
to touch much more of the byte string.