split popover functions into new coffeescript.  got it reasonably styled
(if not too polished) and dismissing correctly
rework the event handlers to dismiss the popover correctly.
quick! commit while it still works!