Bind click events before showing modal

Ensures that the actions for clicking okay and cancel are bound before showing the modal. In practice, this only makes a difference in tests, where frameworks such as Capybara might click the confirmation button before that button has been bound to a function.