Consider edgecase where textInput event gets triggered
Restore some API improvements.
Expose addNewline and use nbsp explicitly.

Changes needed in order to support the Substance Code node type.
now pasting new lines and spaces is working properly
used the new htmlize function for last michael's commit
refactored new function with regex, now tabs included
renamed htmlize to a better toHtml name
refactored the paste functionality, linebreaks from code working, also bug when selfpasting removed + some small improvements