When a popover is closed, clear insideScope

insideScope remembers the item on which the popover is currently open. This
is used to determine, on selection change, whether a popover needs to be
opened. It needs to be cleared when a popover is closed, otherwise it becomes
impossible to open a popover on the same element immediately afterwards.

Refs #385.
Merge pull request #36 from wysiwhat/oerpub-ticket385

When a popover is closed, clear insideScope
Move mousedown handler completely out of event handlers.

This fixes #409. The way it was it would add and remove the mousedown
handler multiple times (for each plugin that uses popovers). It seems a race
condition then ensured that it wasn't added at all. With this change, it is
added once when the module is loaded.
Merge pull request #40 from wysiwhat/oerpub-ticket409

Move mousedown handler completely out of event handlers.
Avoid errors with undefined populator, selector

For reasons I could not determine, and which disappear whenever you add a
debugger to the mix (that is, it is a race condition), The populator and helper
members are sometimes undefined causing errors. In addition, this code makes
sure we don't get the entire hierarchy if more than one parent matches
the selector, for we most certainly don't want more than one popup.

Fixes #408.
Sync with coffee
Rename mimeType to type inside keyDelay function

It overwrites the mimeType variable in the outside scope. Not harmful
as used here (yet) but likely not what was intended.
Add Plain Text option to math popover

This allows math to be converted back to plain text. Fixes #413.
Add math cheat sheet functionality
Styling fixes, make sliding animation work.
Use hide event when closing math widget

This ensures that all the hiding machinery is in one place.
Alter height of editable when opening cheatsheet

This allows you to scroll the popover into view if you're editing math
towards the bottom of the page, and the popover is covered up by the
cheatsheet.
Merge branch 'oerpub-ticket414' into testing

Conflicts:
	src/plugins/oer/math/lib/math-plugin.coffee
	src/plugins/oer/math/lib/math-plugin.js