Bunch of improvements for entity / img support.

* Add export / import.
* Fix issue where entity attributes were being copied to other characters.
* Fix issue where consecutive identical entities were being collapsed into one.
* Misc. refactoring / cleanup.
Force CodeMirror refresh after adding entities.
Batch line marking operations to improve performance (especially on initial load).

Also, fix parseHtml() tests I broke with image support.
Provide an "entityHandle" to the entity render function that lets it later find the entity, remove it, or replace it.
Fixed EntityManager exportToElement
Changed args order for EntityManager tryRenderToElement_ to make entityHandle non required
Updated build
Merge branch 'fix_entitymanger' into firebase