Autosaves defaults when the window is closed

If a user was editing a field and closed the window without tabbing
out, the value was not guaranteed to be saved.
Merge pull request #68 from lindegroup/auto-save-defaults

Autosaves defaults when the window is closed