A little bit of restructuring work on the text editor.

This is needed because we'll be adding some more complex stuff in the next commits, namely script error output.
Initial work on compilation output for scripts in the text editor.
More work on the script compilation output system.

This marks the end of issue #27