Fix issue where trailing newline is removed 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