GUI with text-editor. Also updates stored file.
Code cleanup
Variable scopes updated (less globals!)