add instructions to README.md, include `npm install` in `make build`.

Summary:
make build fails when running the first time, which is a pain because it gives absolutely no indication of why it failed except that it can't find browserify.

this allows make build to run correctly. also it adds some more documentation.

Test Plan: run `make build` after `git p` succeeds

Reviewers: eater, jack

Reviewed By: jack

Subscribers: jack

Differential Revision: http://phabricator.khanacademy.org/D9402
substate khan-exercises
Expression input 2.0: MathQuill

Summary:
This commit replaces our previous "enter math as plain text, get LaTeX render"
with the [MathQuill dev branch](https://github.com/khan/mathquill/tree/dev).

- `MathInput` encapsulates `MathQuill.MathField` in a React component
- `InputWithExamples` can now toggle between basic text input and `MathInput`
- `KAS` is now included locally in `lib/` for easier development

Test Plan:
Tested rendering, answering, and general interaction in test.html on desktop
Chrome, Firefox, and Safari: everything seems to work! Also tested on iOS and
Android and got various bugs.

Reviewers: jack

Reviewed By: jack

Subscribers: elizabethlin, khirasaki, eater

Differential Revision: http://phabricator.khanacademy.org/D9014
Removing obsolete TODO

Test Plan:
No code changes

Auditors: jack
Fixed more touch-related Orderer breakage

Summary:
Orderer no longer removes cards with unbound events by not adding
event handlers to cards that are currently animating. Additionally, you'll
no longer get any JavaScript errors if you tap on a card bank while another
card is animating back into position.

Test Plan:
- Run Perseus on a touch device.
- Create an Orderer ([shortcut](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5Cn%5Cn%5B%5B%E2%98%83%20orderer%201%5D%5D%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22orderer%201%22%3A%7B%22type%22%3A%22orderer%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22options%22%3A%5B%7B%22content%22%3A%22%24x%24%22%7D%2C%7B%22content%22%3A%22%24y%24%22%7D%2C%7B%22content%22%3A%22%24z%24%22%7D%5D%2C%22correctOptions%22%3A%5B%7B%22content%22%3A%22%24x%24%22%7D%2C%7B%22content%22%3A%22%24z%24%22%7D%5D%2C%22otherOptions%22%3A%5B%7B%22content%22%3A%22%24y%24%22%7D%2C%7B%22content%22%3A%22%24z%24%22%7D%5D%2C%22height%22%3A%22normal%22%2C%22layout%22%3A%22horizontal%22%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22hints%22%3A%5B%5D%7D)).
- Place a few cards in the live area.
- Open up the console.
- While a card is animating back into position, click on it. Notice that there are no warnings.
- While a card is animating back into position, click on any bank card. Notice that there are no errors.

Reviewers: jack

Reviewed By: jack

Subscribers: eater, alpert

Differential Revision: http://phabricator.khanacademy.org/D9516
V1 of the image widget, which allows labelling of user-provided images.

Summary:
V1 of the image widget, which places a (blank) Graphie component
behind the user-provided image. Allows custom scaling and addition/deletion of
labels, which have their own custom coordinates and alignment.

Test Plan:
- Run Perseus.
- Test on some [graphie-to-png](http://graphie-to-png.kasandbox.org/) images.
- See [here](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20image-widget%201%5D%5D%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22image-widget%201%22%3A%7B%22type%22%3A%22image-widget%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22backgroundImage%22%3A%7B%22url%22%3A%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2F869c0d9c9103440c3d541cc458f3fbd4d4e380a8.png%22%2C%22width%22%3A321%2C%22height%22%3A320%7D%2C%22box%22%3A%5B321%2C320%5D%2C%22labels%22%3A%5B%7B%22content%22%3A%22Hello%22%2C%22coordinates%22%3A%5B0%2C2%5D%2C%22alignment%22%3A%22right%22%7D%2C%7B%22content%22%3A%22Goodbye%22%2C%22coordinates%22%3A%5B-5%2C3%5D%2C%22alignment%22%3A%22left%22%7D%5D%2C%22range%22%3A%5B%5B-10%2C10%5D%2C%5B0%2C5%5D%5D%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22hints%22%3A%5B%5D%7D) for an involved example.

Reviewers: jack

Reviewed By: jack

Subscribers: alex, eater

Differential Revision: http://phabricator.khanacademy.org/D9298
Fixes for (and an improvement to) AnswerAreaRenderer

Bug 1: Editor props were not being transformed to renderer props.
Bug 2: `onInteractWithwidget` was called before `setState` in the `onChange`
handler, which is bad because it also includes a call to `setState` which
causes a render with stale information immediately before a good renderer.
Most components survive this unscathed, but this makes MathQuill lose focus.

Improvement: Only delete and recreate the Acceptable Formats qtip if the
examples inside have changed in some way.

Test Plan:
Confirmed that MathQuill shows the same behavior in question area,
answer area ("multiple"), and answer area ("expression/equation").
Confirmed that Expression is no longer pre-filled with correct answer
on local copy due to lack of a transform step.
Saw fewer "jQuery has removed a node belonging to React" console logs.
Points now delete properly in click-to-add-points

Summary: Deletion was broken when we fixed the points-always-stay-orange-on-tablet bug.
The issue is that the mouse-out and mouse-over events had to be bound to vmouseout and
vmouseout. This doesn't revert the points-always-stay-orange fix because we're only
binding these events when we think we're on a mouse device anyway.

Test Plan: Add and delete some points in the browser and on a tablet.

Auditors: jack
Add a guard around drawing if a movable has been removed

Test Plan:
undo the mouseup -> vmouseup previous commit, then
test removing click-to-add points via the trashcan,
and make sure it doesn't give a js error

Auditors: charlie
Move to react-components

Summary:
I replaced `BlurInput`, `ButtonGroup`, `InfoTip`, and `Tooltip` with
their react-components equivalent. I didn't yet replace `TeX` because
I'm not sure about the `typeof Exercises === "undefined" ||
Exercises.useKatex` line.

This is not quite complete yet - I need feedback from reviewers on how I
should get the styles. I'm tempted to move react-components over to RCSS
so styles will always be packaged with components. The other alternative
is to add react-components as a subrepo.

Test Plan:
* make server
* open dev:9000
* find an example of each component to play with.

Reviewers: jack, kevin

Subscribers: alex

Differential Revision: http://phabricator.khanacademy.org/D9370
MathInput: Mimic <input> behavior + avoid unnecessary onChange call

Test Plan:
When testing in webapp locally, pressing enter from within a MathQuill input
submits the answer just like in an actual <input> element.

Auditors: jack
CSS fixes for Expression widget

The first fix is more specificity, so that MathQuill default styles are
correctly overriden in webapp. The second fix concerns the error tooltip
in the answer area - using the default styles, it scrolls off up and to
the right! To avoid horizontal scrolling in the answer area we'll display
the tooltip to the left instead, and to avoid vertical scrolling we'll put
it directly on top of the Expression widget's MathQuill input.

Test Plan:
Confirmed expected apperance in both test.html and local webapp.

Auditors: jack
Delete References to unmounted items & correctly unmount format answer examples.

Summary:
There is no need to keep around refences to unmounted PerseusTranslationComponents,
so I now set them to null when unmounting.  However I noticed that one component
still stuck around after this change.  It turns out the format answer component
was never properly unmounted, because it was removed by jquery.  React was spitting
out a warning about jquery removing a react component.  It still does it when you
hover over the format answer qtip at some point, but the warning is no longer true.
We do unmount it, but since the qtip created an exact copy of the html, React thinks
it owns it when it actually doesn't.

Test Plan:
make all
Go to http://translate.khanacademy.dev/preview/content/items?exercises=functions_1#x4e7134ce
Click between different items, making sure to occassionaly hover over the tooltip.
In the console type:
window.PerseusTranslationComponents
and see that all the components are now null except for the currently loaded assessment items
components.

Reviewers: jack

Reviewed By: jack

Subscribers: alex

Differential Revision: http://phabricator.khanacademy.org/D9389
No longer auto-capitalize or auto-correct for math inputs.

Summary:
Previously, some inputs that actually handled math were auto-capitalizing and auto-
correcting, such that if you typed a lower-case variable name, it would be capitalized and
marked as incorrect, which is a huge pain on touch devices. Now, those inputs are defaulted
with this behavior turned off.

Test Plan:
- Turn off useMathQuill in test.html.
- Turn on your favourite touch device.
- Create an expression widget ([shortcut](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5Cn%5Cn%5B%5B%E2%98%83%20expression%201%5D%5D%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22expression%201%22%3A%7B%22type%22%3A%22expression%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22value%22%3A%22%22%2C%22form%22%3Afalse%2C%22simplify%22%3Afalse%2C%22times%22%3Afalse%2C%22functions%22%3A%5B%22f%22%2C%22g%22%2C%22h%22%5D%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22hints%22%3A%5B%5D%7D)).
- Type in a single-word variable name, such as 'p', and note that it is not auto-capitalized.
- As a stronger challenge, type in 'i'. Note that 'i' is neither auto-capitalized nor auto-corrected to 'I'.

Reviewers: jack

Reviewed By: jack

Subscribers: alpert

Differential Revision: http://phabricator.khanacademy.org/D9697
Makefile: re-add commit hash to perseus-0.js

Summary:
I forgot to use the perseus-0.js variable instead of perseus.js
for perseus' Makefile header text. This corrects that so it gets
the appropriate header text

Test Plan:
make build; examine build/perseus-0.js

Auditors: alex
Messy first pass at a perseus API for mobile

Summary:
A rough first pass at an api for mobile and `onInputError` functionality

Adds apiOptions as an optional prop for ItemRenderer and Renderer,
and adds support for `onInputError`

Test Plan:
 * input-number:
    * made an input-number
    * entered "2--"
    * graded it
    * made sure i got an alert
 * expression:
    * made an expression
    * entered "2--"
    * made sure it gave me an alert after a couple seconds
    * made sure it gave me an alert on grading
 * checked correct/incorrect grading for both the above widgets (with
   "5" and "x+1" solutions respectively)

Reviewers: charlie

Reviewed By: charlie

Subscribers: alex, mgp, laura

Differential Revision: http://phabricator.khanacademy.org/D9387
Add a `setInputValue` to the Perseus API

Summary:
calling setInputValue(widgetId, valueString) change the value of an input-number or expression widget.
hopefully useful for clients to write their own input things.

Still rough, but hoping it's a decent v0 :)

Test Plan:
Run the following in the command line:

    itemRenderer.setInputValue("input-number 1", "5")
    itemRenderer.setInputValue("answer-area", "5")
    itemRenderer.setInputValue("answer-input-number 1", "5")

with the appropriate widgets existing, then
verified the widgets values changed as expected

Reviewers: charlie

Reviewed By: charlie

Subscribers: alex, laura, mgp

Differential Revision: http://phabricator.khanacademy.org/D9431
Add `interceptInputFocus` to the perseus API

Summary:
Allows clients to specify a function that gets called instead of
focusing an input.

Test Plan:
Added `interceptInputFocus` to test.html, tried clicking on and
tabbing to an input in test.html
Also tried with `interceptInputFocus` set to undefined/null and
make sure things still worked

I haven't really tested this enough; #yolo!

Reviewers: charlie

Subscribers: alex, laura, mgp

Differential Revision: http://phabricator.khanacademy.org/D9440
Add some css classes to the perseus API

Test Plan:
Added the following css to perseus.less:

    .framework-perseus .perseus-input {
        background-color: blue;
        &.perseus-focused {
            background-color: green;
        }
    }

And checked that the input-numbers and expressions showed up
blue when unfocused and green when focused

Reviewers: laura, charlie

Reviewed By: charlie

Subscribers: alex, mgp

Differential Revision: http://phabricator.khanacademy.org/D9503
Add basic renderer api test

Summary:
 * Adds KAS and katex to our test environment
 * Adds simple tests for the renderer's Perseus API [for mobile]
   functionality

Test Plan: make test && make jest

Reviewers: charlie, joel

Differential Revision: http://phabricator.khanacademy.org/D9643