Made ScriptEditor compatible with saving API. Also fixed missing last line in saving. Adds #40 @15m.