fix Cursor::insertCmd/LatexCommandInput::renderCommand

wasn't correctly merged from master:
- master refactored LatexCommandInput::renderCommand to just call
  Cursor::insertCmd, and added a public API call that calls
  Cursor::insertCmd
- dev changed how fragments worked, which changed
  LatexCommandInput::renderCommand. In the merge conflict, the dev
  version of it was kept

This commit now fixes insertCmd and refactors dev's renderCommand
to use it.
'.ch' => '.endChild'

sed -i '' 's/\.ch[[:>:]]/.endChild/g' src/*.js test/unit/*.js

because .ch is completely obscure.

See also:
https://github.com/mathquill/mathquill/pull/106#issuecomment-8017419
'.ends' => '.end'

sed -i '' 's/\.ends[[:>:]]/.end/g' src/*.js test/unit/*.js

to match .endChild, 9c7c6930e6dab4af3b3fc830bb83c938f78f99dc.

See also:
https://github.com/mathquill/mathquill/pull/106#issuecomment-8017419
first => left{End, end}, last => right{End, end}

and one instance of 'first' meaning 'leftmost' and not 'left end'
fix "{first,last}Child" in tree.test.js assert msg

"{first,last}Child" => "{left,right} end child"
prev => leftward, next => rightward

except in certain comments, 'prev' => '[L]' and 'next' => '[R]'
insertAdjacent => insDirOf

sed -i '' 's/insertAdjacent/insDirOf/g' src/*.js
appendDir => insAtDirEnd

sed -i '' 's/appendDir/insAtDirEnd/g' src/*.js
"insert{Before,After}" => "ins{Left,Right}Of"

except gotta be careful not to replace the instances of calling
jQuery.fn.insert{Before,After}
"{pre,ap}pendTo" => "insAt{Left,Right}End"

except gotta be careful not to replace the instances of calling
jQuery.fn.{pre,ap}pendTo

also in moveUpDown comments, have to add 'of' for grammaticalness
reword comments/assert msgs to not say pre/append
$ is now a directionalized subclass of jQuery,

rather than just an alias. It's in tree.js, immediately after the
directions are defined.

All the directionalized jQuery calls in cursor.js are now way prettier.

For minification, `jQuery` rather than `$` is now closured in intro.js.
Of course, in publicapi.js, now the MathQuill plugin has to be attached
to `jQuery.fn` not `$.fn`.

Pjs had to be upgraded to v3, because jQuery internally calls
this.constructor() like a million times every time you so much as think
about sneezing at it.
Still some jQuery features don't work on $ (thoroughly documented in $'s
comment block), requiring a place in publicapi.js and textarea.test.js
each to use jQuery instead of $.

Other misc. change: textarea.js comes before tree.js and jQuery is
supposed to be its only dependency anyway, so.
Merge branch 'master' into refactor.directions

Conflicts:
	src/commands.js
	src/cursor.js
	src/publicapi.js
	vendor/pjs
createBefore => createLeftOf

sed -i  '' 's/createBefore/createLeftOf/g' src/*.js
use .endChild[L] not .firstChild

silent semantic merge conflict
TextBlock::parser()'s returned Parser yields self

rather than creating a new TextBlock instance, creating its blocks and
adding text to it, and yielding that, just create my blocks and add text
to me and yield self.

A minor mistake we probably made because we were in the mindset of
\left's Parser, which has to create a new Bracket instance (or subclass
thereof).
TextBlock::onKey => InnerTextBlock::deleteOutOf

fix backspace and arrow keys in TextBlocks, helps with #121

Oh my god, deleteOutOf is so much prettier, simpler, and cleaner than
doing key checking logic in onKey! And it, y'know, works, which also
technically counts as improvement.

Discovering abstraction barriers and watching it simplify everything is
such a magical feeling.
get rid of Cursor::insertNew

it was just a thin wrapper for MathCommand::createLeftOf
refactor Cursor::write/insertCh()

First of all, the selection logic is separated from the character
parsing in insertCh() and moved into write(), which does it by calling
prepareWrite().

The ill-placed selection logic in the .mathquill('write', latex) public
API call is deleted now also just calls Cursor::prepareWrite().

So, prepareWrite() is like prepare{Move,Edit} except instead of calling
{clear,delete}Selection, it calls replaceSelection().

They both return the Selection Fragment, which is totally not clear from the
name of prepareWrite(), but it hopefully will get better refactored
later into this environments refactoring, for now it just refactors
duplicate code between Cursor::write and the .mathquill('write', latex)
public API call.
Cursor::insertCh now a wrapper for .parent.write()

math-specific character-writing logic moved to MathBlock::write()