Fix a variety of horrible bugs I added.

TextPane no longer leaks memory like there's no tomorrow.
Selection works again.