API docs in README separate editable from static
Add and document public API methods used by Desmos

Names changed to protect the guilty, and to be a little more specific,
hopefully a little less likely to become ambiguous or need deprecation
in the future.

I don't really love committing to the .keystroke() key event string
format, but it'll probably be fine.
Add Selection::join() so can do .join('latex')

a la MathBlock::join()
Fix and test new API methods

Fix MathQuill.MathField::select() #ImAnIdiot

Fix updown.test.js setup instantiates a MathQuill.StaticMath to test
up/down -- just coincidence that static math instances have a cursor
(for now) and so the test worked.
Add 'upOutOf' etc handlers on MathField's to API

Instead of moveDir/moveUpDown/deleteDir/selectDir in keystroke.js
checking whether a node is the root for this controller or not, use
polymorphism: new RootBlockMixin that overrides all of .upOutOf() etc
to not escape the block is used to extend MathBlock into RootMathBlock,
and RootTextBlock extends RootMathBlock like it used to rather than
MathBlock. RootBlockMixin() is also called on \MathQuillMathField{}'s
MathBlock; thanks to how Pjs mixins are just ordinary functions, that
just does the right thing.

I'm not worried about an infinite loop in moveUpDown because unless the
.parent chain is actually circular, there'll eventually be a null
dereference. (There's no simple check for a circular .parent chain, if
that's the case we're fucked anyway.)

The constructors for MathQuill instances now take an options object.
Currently only support `handlers` option: RootBlockMixin's overridden
.upOutOf() etc will call handlers.upOutOf() etc. See new docs.

Recommend -w to view diff.
(Because indented current 'Public API' tests under 'simple' suite and
added '*OutOf handlers' tests after the 'simple' suite.)
Fix Shift-Enter, Ctrl-Enter inputting newlines
Add 'enter' handler to MathField API
Simplify AbstractMathQuill::redraw #tiny

Just use .postOrder(), rather than manually doing recursive post-order
traversal.
Rename 'redraw' hooks to 'edited' handlers

Same specificity in terms of when it's triggered, useful more generally
as a hook.
Add 'edited' handler to MathField API

Also, update redrawing test, which pastes in stuff that needs resizing,
to also test that 'edited' handler is called.

Recommend -w to view diff.
moveUpDown() uses .bubble inst. of loop thru ancestors #cosmetic
{up,down}{Into,OutOf} stops bubbling by default

Default to "break", but still allow returning exactly `true` to
explicitly "continue". It's worth noting that as yet nobody whatsoever
wants to "continue", and I can't think of why anyone would, but it's
easy enough to support.

Prep for all the RootBlockMixin handlers being merged together; can't
return false in 'edited', or else a \MathQuillMathField{} inside
something that needs to know, like a square root, won't resize
correctly.
Add test case for \MathQuillMathField{} in fraction

This issue was described by https://github.com/mathquill/mathquill/commit/b03a8e7f8a4ad45dca13ff6a13c99a58fb553230#commitcomment-1746333

It was also fixed by c1fe1ef5797f69d39c6b952aaacd48d51d2b5705 a year
ago, but no test case was added, and in fact no tests (even visual) fail
without the important loop breaking behavior that was refactored in the
parent commit.
rm {left,right,backspace,del,select{Left,Right}}OutOf

Because fuck that noise.

Can and should be done in a layer on top of MathQuill.
Provide mathField to handlers

...as last argument, so can be ignored.

Wow, I did a lot of hand-wringing about these changes that ultimately
had little visible effect on the final diff.

First, I got all worked up about the root block having access to the API
object being a layer violation. I tried, instead of the API binding
handlers directly to the root block, having the API bind handlers to the
controller which then bound handlers to the root block, which would call
the handlers bound by the controller which would then access this.API to
hand back to the external handlers. But that meant duplicating the
hardcoded list of handlers, which was significant extra code, especially
a few commits ago when {up,down}OutOf and the non-directionalized
{left,right,backspace,etc}OutOf handlers were different from everything
else. I was so disillusioned I wrote up an almost fully functional
.on()/.off() events system:

    _.on = function(evt, listener) {
      if (!/^(?:(?:move|delete|select|up|down)OutOf|edited)$/.test(evt)) {
        throw 'MathQuill: no such event "' + evt + '"';
      }
      var API = this;
      var events = API.events || (API.events = {});
      var listeners = events[evt] || (events[evt] = []);
      listeners.push(listener);

      if (!API.controller.root[evt]) {
        API.controller.root[evt] = function() {
          for (var i = 0; i < listeners.length; i += 1) {
            listeners[i].apply(API, arguments);
          }
        };
      }
      return API;
    };
    _.off = function(evt, listener) {
      if (!/^(?:(?:move|delete|select|up|down)OutOf|edited)$/.test(evt)) {
        throw 'MathQuill: no such event "' + evt + '"';
      }
      var listeners = this.events && this.events[evt];
      for (var i = 0; i < listeners.length; i += 1) {
        if (listeners[i] === listener) listeners.splice(i, 1);
      }
    };

The only problem is, when do Controller::{move,delete,select}Dir() in
keystroke.js call .{move,delete,select}OutOf? Always, but everything
defaults to noop instead of the "pray('I should never be called')" like
now? Or keep all the RootBlockMixin stuff, and just default those to
noop?

Eventually I realized I can just treat the API as an opaque extra
context argument for handlers that is of no concern to the
RootBlockMixin, just be nice and pass it along for me, kthxbai.

Then I got all worked up about the argument order for the
{move,delete,select}OutOf handlers: should they be (dir, mathField) or
(mathField, dir)? The latter is easier to implement (assuming the
handlers don't pay attention to arguments.length), and is kinda more
systematic externally, but externally the actual client code is always
gonna be different from the directionalized handlers, and are often
gonna want to ignore the API object argument. Turns out with a little
work, it can still be reasonably compact.
Merge pull request #241 from mathquill/api.desmos

Add and document public API methods used by Desmos