Displays alert if editor is dirty before unload

closes #1327
- Prevents user from accidently losing changes
Moving dirty editor handling out of uploadMgr

issue #1327

- just moved to be in editor obj, everything else is the same
Preventing incorrectly shown unload alert

issue #1327

- IE9 fires an unload when using Backbone.history.navigate which meant the alert always got shown on first save when the url changes from from /editor/ to /editor/id. Not sure if other browsers do this, but this workaround fixes it
Merge pull request #1331 from zacgeis/dirtymessage-fix