editing textContent has side-effects! & formatting

now only edit .textContent if we have a reason to edit it.. (turns out, writing to .textContent all the time makes it really hard to copy & paste the text.. at least on firefox)

also run the code though jsbeautifier.org