[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.