Add util code for modal dialogs; replace window.confirm with this
Prompt user before navigating away from unsaved changes, fixes #55