Refactor to create JavaToJavaScriptMapImpl

Convert an anonymous class to an inner class via refactoring.
(This is to make testing code that requires a jjsmap easier.)

No user-visible changes.

Change-Id: I1e906607d53e3bce099c8ab1886c2c52ad5faff8
Review-Link: https://gwt-review.googlesource.com/#/c/6091/
listIterator().add() increments index after List.add() succeeds.

This prevents a failed add() from corrupting the state for future
users of the ListIterator. See equivalent JDK bug
bugs.sun.com/bugdatabase/view_bug.do?bug_id=6533203

Change-Id: I3bac7ed0f0be75bdeab2df3b3e32d8f0de54ec89
Review-Link: https://gwt-review.googlesource.com/#/c/6100/
Fix String.trim() to behave as in Java for string with null characters.

Bug: issue 8534
Change-Id: If45002f78ec8f8be7b1197606de6529ed273b837
Merge remote-tracking branch 'upstream/master'