Don't remove trailing newline when editing a file in web UI editor:

* populate ACE editor content via API instead of HTML element inner text (to preserve trailing whitespace).
* remove hack in EditTreeController#preview that replaces any removed \n.

Fixes #5936
Merge pull request #7222 from jhund/fix-5936

Don't remove trailing newline when editing a file in web UI editor