[TASK] ADWD-1465 Confirm discarding unsaved changes

- Only enable save button if there are unsaved changes
- Create save button after page render, remove from templates
- Small code cleanups
Merge pull request #142 from subugoe/confirmchanges

[TASK] ADWD-1465 Confirm discarding unsaved changes