ESC key closes modals

Add a key handler that triggers 'modal:hide' when ESC (keycode 27) is
pressed. Configurable with the escToCancel flag.