Implement @chrisbartley use case: Re-run shorten after changing the text. If tooltip is enabled but the text now fits, remove obsolete tooltip.
test.html: Wraps the the shorten calls in a function so I can test re-running shorten on elements
Some refactoring for efficiency