Change shorten algo

This should resolve https://github.com/kivy/kivy/issues/1703.

It changes the shorten algo to make it faster (it only computes the extents once per char). It also makes it a bit nicer, I believe. I tested it with many different cases.

The problem before was that although extents was called for chars at the end of the string, chars in the middle of the string was removed, and that could have different widths.