TextPane tidying.

- Use new LinePosition method.
- Split some of the huge methods up into smaller ones.
- Fix some Netbeans-induced wonky line wrapping.