Hide bubbles by click on document and by esc button

Now user can close opened bubble only by clicking on image. In this pull-request I offer to close bubbles by clicking on any point of document and by keyboard (esc button).

And also small refactoring in `getLabelmakerPoints` function:)