Displays alert if editor is dirty before unload

closes #1327
- Editor now tracks dirty state
- Prevents user from accidently losing changes