Bind esc/enter to modal

Implementing #403 Issue request.