[Fixes #1548] Watch for escape button being pressed

Fixes Issue #1548 

First we define the jQuery object as $ using requirejs (line 6), we then use jQuery to bind the keyup event to the body (line 61). When the event occurs we use the escapeEvent function (lines 76–82) to verify that it was the escape key (keycode 27) that was pressed. If it was, we then use $scope.close() to close the opened "panel" and then unbind the event from the body to ensure we aren't using up memory / cpu for no reason.
Removal of the event handler needs to happen when the $scope is destroyed, not when escape is caught. Otherwise the handler will stay bound forever if the user clicks the close button.

```js
$scope.$on('$destroy', function () {
  $(element).off('keyup', $scope.escapeEvent);
});
```