Put setting text writes in the writing to the DOM loop

Also moved updateClickableItems to happen between writing text to the
DOM and writing items to the DOM.
Added more intelligent this.stretchedElements