This relands commit 7713d18847 which was
reverted in commit 3ac0bcb095.
Original description:
* Undo/redo restores cursor position
* Multiple deletes are consolidated into a single operation
* Don't create undo history for invalid or no-op operations
* Move logic for merging operations into Editor.EditOperation
CTS tests in android.widget.cts.TextViewTest will land separately.
Bug: 19332904
Bug: 19450037
Bug: 19505388
Change-Id: Ice27e3c4e5e421b47be8c4e9964c10844e61b0fc