Refix issue #189 and #172.

Shortly before Christmas I fixed issues 172 and 189, which had to do with popovers not working properly with multi-line content and jumping around, which I fixed by repositioning a popover on key/mouse event rather than by a timer event. This was on a copy of the popover code, and it did not survive reunification. This is a redo of that fix.

This also includes a small fix on the math popover, because aloha-selection-changed needs to be fired with two bits of data (not just one), the range object AND the original event that caused the selection change.