make notice not a global var.
Properly refer to iD.ui.confirm
Create method history.hasChanges
add history.numChanges method.

Use hasChanges/numChanges to toggle Save button and show confirmation dialog when navigating away from page.