Whitespace
Explicitly close the modal after clicking on the commit button

To be sure it gets closed, even if the delegated event fails.
DRY up and indent the modal HTML generation (refs #3)