Tidied up editor exiting/cleanup code
Merge pull request #38 from firecat53/master

Cleanup editor exiting code.