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.