Improve text selection by giving all text elements a right and bottom padding,
that pads the element right to the nearest right and bottom element.

Calculating the proper amount of padding is not straightforward. To do so,
we must find the nearest right and nearest bottom element, which can be an
O(N^2) operation if it is done naively. Instead, we use a quadtree data
structure which makes it easy to do lookups based on location.

Also add a number of tests for the quadtree.
Change the way we implement iterating in the quadtree. Previously we would call a user-specified function. However, that was inefficient and could lead to a possible O(N^2) issue in some cases, and would use more memory than necessary.

Now we return iterator objects.

This required changes to the tests, but not many substantive changes.
Some minor optimizations. Also, transform the text by 1.0x even for single chars.
Merge in newest changes from padding-text-for-selection.