preserve focus/visibility state of text editor (fixes #318)

This change fixes #318 by ensuring that the visibility/focus state of the HTML textarea element is only modified when the requested state is different from the current state, and by toggling *style.visibility* when setting visibility rather than appending/removing the element to/from the document.

To make that latter change, I had to figure out another time it would be appropriate to append/remove the element. I initially considered *init*/*finalize*, but I don't think our VM ever calls *finalize*. So I settled for *CanvasItem.setParent*, which appears to get called before the editor is expected to appear, and which can be called with a `null` argument to unset the parent (although it isn't clear that midlets all do this, which is a potential issue; the BlogWriter test midlet does it, but another midlet that I'm testing doesn't appear to do it).

I also improved the code for setting the caret position, as the *TextEditor* class expects it to be settable at any time, but we can't actually set it in the HTML element until the element is appended to the document.

And I realized that the *insert* and *delete* methods weren't being tested and weren't setting the caret position, so I added tests and made them set it to reasonable values. The [TextEditor docs](http://developer.nokia.com/resources/library/Java/_zip/GUID-237420DE-CCBE-4A74-A129-572E0708D428/com/nokia/mid/ui/TextEditor.html) are vague, but they do say:

> Application can add a TextEditorListener to the TextEditor for example for keeping track of user navigation (caret movement) and other content changes such as text selection. The events are sent on all occasions that cause the caret position to change (including but not limited to text typing by user, programmatic text insertion, navigation within the TextEditor content, and text deletion).

So I set the position to the end of the inserted text, when text is inserted, and the position at which text was deleted, when text is deleted.