Remove keypress handler when modal closes
Remove keypress handler when modal closes

-Previously, the handler for closing modal dialogues was removed when the keypress occurred but not when the dialogue was dismissed by mouse click. This means that if a user clicks out of a modal confirm alert and then tries using the enter key, the confirm() function of the modal would fire instead of the intended action.
-Refactoring the modal javascript fixes this.

colealanroberts/Exprecss,colealanroberts/Exprecss