[Fixes #1548] Watch for escape button being pressed

Fixes Issue #1548 

First we define the jQuery object as $ using requirejs, we then use jQuery to bind the keyup event to the body. When the event occurs, we 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".