Add widgets shortcuts

Summary: Quick insert of widgets into the editor via keyboard shortcuts

How it works:
1. While writing the question/answer/hint, tap CTRL
2. You have now half a second to type the shortcut of a widget to quickly add it (for example: 'N' for the number line)
3. Press spacebar to immediately insert the widget, or just wait
4. Rinse & repeat

Thought this could be useful for someone who writes a lot of exercises :)

What has been done
* Added a onkeyUp handler to detect the CTRL key and to start the capturing of the shortcut
* Added a onkeyDown handler to capture the shortcut characters
* Added a method to Util for simulating events
* Extracted a shortcut of each widget based on its name, and displayed it on the widgets dropdown
* Added a info tip to notify the user of the shortcut feature
* Fixed a discrepancy between FF and Chrome with the margins of the <select>s in .perseus-editor-widgets-selectors
simple-markdown: some small compatibility fixups

Summary:
Makes `codeBlock`s gobble up trailing newlines,
Makes single item lists paragraphs if they have block-level elements
inside them (as designated by double newlines)

Test plan:
Added a code in lists test to `make test`

Auditors: emily
simple-markdown: allow multiple spaces after * in lists

Summary:
Especially relevant for tabs after the * in lists. This
is how marked.js works

Test plan:
`make test`

Auditors: emily
simple-markdown: fix extra newline after list items

Summary:
Strips the trailing '\n' seen in simple list items.
This makes cross-testing with marked.js a bit easier

Test plan:
`make test`

Auditors: emily
simple-markdown: don't let > escape from a paragraph

Summary:
Fixes a bug where inline `>`s would become a blockquote
even when they were in the middle of a paragraph

Test plan:
`make test`

Auditors: emily
simple-markdown: allow trailing whitespace after a code block

Summary:
fixes an incompatibility with marked.js where a trailing
indented line would prevent a code block from being
recognized as code (it would just become a paragraph).

Test plan:
`make test`

Auditors: emily
simple-markdown: don't allow defs inside paragraphs

Summary:
previously, using a [def]: like this inside a paragraph
would turn that part of the text into a def (thereby hiding it).
This should just be inline text in the paragraph since it's not
at the block level.

This change is a very, very hacky fix to that. The right
fix involves either parsing a group of defs at once, or
adding block vs inline parameters to the regexes in the
grammar, which we might have to do to comply with
"standard markdown" anyways.

Test plan:
`make test`

Auditors: emily
Future-proofing Perseus for coming JSX changes

Summary:
See http://fb.me/react-legacyfactory.

TODO: $_

Depends on D12798.

Test Plan: Open each widget and play with it a little. The only remaining JSX warnings are from <$_>, which I'll fix up separately.

Reviewers: aria, joel

Reviewed By: aria, joel

Subscribers: alex, jessie

Differential Revision: http://phabricator.khanacademy.org/D12796
Don't autofocus new expression widget

Test Plan: Loaded test.html with an expression widget, nothing blew up.

Reviewers: aria

Reviewed By: aria

Subscribers: jessie

Differential Revision: http://phabricator.khanacademy.org/D12870
New Matrix Widget

Summary: The matrix widget allows you to create an interactive matrix "board", where the student can create a matrix (or vector) up to the max size of the board. The user is warned when they enter an incomplete matrix that is the correct size (i.e. with blank cells). You can also specify an optional prefix or suffix for the matrix (e.g. M = [Matrix]). Fixes T3034.

Test Plan:
Create a matrix widget in perseus and try to break it!
Things to watch for:
- Does the matrix grade correct, incorrect, and incomplete as you would expect?
- Do the matrix braces always line up with your cursor and the matrix content?
- Does changing the max matrix size affect the inner matrix answer the way you would expect?

Reviewers: aria

Reviewed By: aria

Subscribers: alex, eater, cameron

Maniphest Tasks: T3034

Differential Revision: http://phabricator.khanacademy.org/D12726
Typed shortcuts

Summary: The user can type directly in the textarea the widgets' shortcuts and they will be replaced on the fly by the widget placeholder. Also, widget insertion in mid-text!

What's been done:
* Added three new Util's methods for handling text manipulation and parsing
* Removed the onKeyUp handler
* Changed the onKeyDown handler to reflect the new solution
* Changed the addWidget method so that it can insert the widgets where the cursor is instead of just at the end of the content
Make shortcuts case-insensitive
Use React synthetic event / Ignore invalid shortcuts
Fix SUPPRESSINSTALL typo

Summary:
Luke added an option to skip running `npm install` for any
Makefile command, which might be useful. This commit fixes
a typo in it.

Test Plan:
`make server`
see that it doesn't warn about the following anymore:

    Makefile:78: warning: undefined variable `SUPPRESSINSTALL'

Auditors: michelle
Avoid usage of data- attribute

I've created a WidgetSelectOption React element that can be referenced by its shortcut (this.refs.widgetSelect[shortcut]) instead of relying on a data- attribute as I did before
simple-markdown: make mailto: links comply with standard markdown

Summary:
[Standard markdown][1] preserves mailto: or MAILTO:
prefixes in the output of mailto autolinks, if the
author included the mailto: in the autolink

[1]: http://standardmarkdown.com/

Test Plan:
`make test`
ran the standard markdown tests and saw the following one pass:

input:

    <MAILTO:FOO@BAR.BAZ>

output:

    <p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>

Reviewers: emily

Reviewed By: emily

Differential Revision: http://phabricator.khanacademy.org/D12857
simple-markdown: Fix thead/tbody elements

Test Plan:
Tested in giant diff between simple-markdown and marked-react

Auditors: emily
Remove unnecessary shortcut prop
Trigger select's onChange via React
Fix shortcuts list

(This most probably just a temporary solution!)

There was a problem the way the shortcuts list was being built after the latest changes.

First of all it was build everytime the render() method was called, which wasn't really optimal.
Secondly, the code kept adding shortcuts in shortcuts.list for the 'Answer' and 'Hint' dropdowns (so you ended up with 'C', 'CA', and 'CAT' as shortcuts for 'Categorizer').

The way I fixed it is to use the shortcuts list as an instance variable of each WidgetSelect so that they don't conflict with one another.

This is obviously not optimal as the list should be only one, shared between the element instances. I tried to build the shortcut list as a 'global' variable but Widgets.getPublicWidgets() return only an empty array up at the beginning, so for now I wrote this solution as a baseline for future improvements.