Replace pawns with unicorns for pre-annotations

When the cursor is pre-annotated, immediately insert correct inline tags, with
the cursor placed inside. Stop the browser collapsing them and/or moving the
cursor out of them, by inserting temporary img tags: "unicorns". Remove the
unicorns at a later refresh when they are no longer needed.

Also unicorn when the cursor is immediately after a link. Render the following
text without link annotation. Move link continuation code to onContentChange,
so that in the model, link annotation will be applied until the next word
break. Accordingly, on rerender the link annotation will show in the view.

ve.dm.Document.js (and ve.dm.TransactionProcessor.js)
* Emit 'precommit' and 'presynchronize' events during commit processing

ve.dm.Surface.js
* Provide a selection clone that is updated before document synchronization

ve.ce.ContentBranchNode.js
* getRenderedContents: include unicorns where pre-annotation requires it
* Register unicorns with the surface so they can be removed when no longer needed

ve.ce.Surface.js
* onInsertionAnnotationsChange: re-render selected content branch node
* afterDocumentKeyDown: if arrow key was pressed, remove unicorns if needed and fix cursor position
* Listen to 'input' event
* Stop listening to compositionstart/end events
* Prepare native left/right arrow handling, but preserve emulation for now
* Stop pawning except in slugs

ve.ce.Document.js
* getNodeAndOffset: account for unicorns

ve.ce.js
* nextCursorOffset: return DOM cursor position after unicorn
* previousCursorOffset: return DOM cursor position before unicorn
* getOffset: account for unicorns
* Minimal 1px GIF data URL (for production)
* Small visible GIF data URL (for debugging)

ve.EventSequencer
* make afterDocumentKeyDown fire after any related keypress event

demos/ve/demo.css
* Give spans a visible border (for debugging)

ve.ce.test.js
* test ve.ce.nextCursorOffset

tests/ce/*imetests*
* Update many IME tests to start with non-empty paragraph
* Update test harness for fewer failures
* Update test harness to expect failures in PhantomJS

Bonus:
* Move initialization of SurfaceObserver#domDocument to constructor
** Otherwise observer starts up too late in the test runner
* Remove useless parameter from setContentBranchNodeChanged()

Change-Id: I99b99e8551bf550547cba623b643b6317f0706da
Merge "Replace pawns with unicorns for pre-annotations"