implement more TextEditor methods

Here's a bunch more implementation of TextEditor, plus some tests. They're backend tests, so don't include frontend tests of the "native UI" (i.e. HTML textarea) itself, but they ensure that the API behaves as expected.

Regarding that native UI: this makes the HTML textarea element itself appear while editing text, which will look out of place stylistically. But that's still better than not being able to see what you type until you blur the editor, which would happen otherwise in some midlets. We should improve the style in a followup.

There are still a few more methods I'd like to implement, like *getVisibleContentPosition*, and others I'd like to improve; but this is a significant set of enhancements and a discrete chunk of changes that are worth landing on their own.