Fix a variety of horrible bugs I added.

TextPane no longer leaks memory like there's no tomorrow.
Selection works again.
Merge pull request #19 from csmith/textpane

Fix a variety of horrible bugs I added.