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
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
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
semi-substate marked-react
simple-markdown: Fix paragraph end delimeter

Summary:
Paragraphs now allow spaces in the newline(s) before their
final newline. Apparently this is something people actually
write.

Test Plan:
`make test`

Auditors: emily
simple-markdown: output actual newlines not spaces

Summary:
For newlines, it now outputs '\n' instead of ' '.
This mostly makes diffing easier but also makes more
sense, given that newlines in text remain '\n's.

Test Plan:
 #yolo

Auditors: emily
simple-markdown: parse urls inside text as a url

Summary:
The first 'http' string inside text was being parsed as text
rather than the start of a url, causing urls to not be
recognized.

This change breaks the `text` rule on http so that this no
longer happens, and adds a test case (and fixes an old test
case).

 #fixingfuturebugs

Test Plan:
`make test`

Auditors: emily
Fix variable name in matrix widget

Test Plan: Grade a matrix widget and notice that it now grades correctly instead of erroring about an unknown variable

Reviewers: aria

Reviewed By: aria

Subscribers: aria

Differential Revision: http://phabricator.khanacademy.org/D13093
Fix graphie movable factory for forward-compat

When I was testing the changes around descriptors, I didn't test this properly with React 0.11, and it of course fails because the factory was producing an instantiated graphie object instead of the descriptor that the rest of the code now expects. I've replaced the factory with a function that acts similarly to ReactDescriptor.createDescriptor does in 0.12, which is the function that ends up being called by the JSX transform. (In React 0.12, this function is never called so this will still work.)

Test Plan: Made an interaction with a movable point and dragged it around.

Auditors: aria
Renderer: fix blur error after removing focused widget

Summary:
If you focused a widget in the renderer, then changed the editor
contents, then focused a new widget, a js error would be thrown trying
to blur the previous widget, which no longer existed. We now check in
blur for the widget existing so that we just allow the blur to go
through.

It might make more sense later on to keep track of when a widget
disappears through a rerender and check for the currentFocus at that
point. But currently we don't really need this.

Test plan:
Make a grapher, then change it to a number-line, and drag the point.
Make sure no js error is thrown.

Auditors: michelle
Graphie: Fix refs

Summary:
We were losing refs added by the new react descriptors.

This change refactors a bit of how we do keys and refs in
<Graphie>; pulling them directly off the descriptor rather
than using the resulting movable object.

This was causing our numberLinePoint ref in number-line
to not be set, which broke clicking on the line to move
the point (since this grabs the ref to call a method on
it).

Test Plan:
 * Make a number-line
 * click somewhere on the line without dragging
 * see no js errors :D

Auditors: alpert