Add text editor element methods needed by packages

In order to avoid using deprecated APIs, the wrap-guide package needs to be able to
* perform adjustments when a text editor element is attached to the DOM
* know a text editor element's default character width