Followup 95ee357: make remapStoreIndexes() work again

Its implementation relied on getAnnotationIndexesAtOffset() returning
the indexes array by reference, but since 95ee357 it returns a copy.

Instead of modifying the annotations array by reference, modify the
copy and save it back using the new setAnnotationIndexesAtOffset()
method.

Also add tests for this function, we evidently need them. This
code was sort of covered by the paste tests in ce.Surface but not
very well. One of the paste tests started failing mysteriously, but
only in PhantomJS and only in the MediaWiki integration with no skin
loaded. It turned out PhantomJS was wrapping things in
<span style="line-height: normal;" class="Apple-style-span">
which was then stripped by afterPaste. However, by the time it was
stripped it was already in the IVStore of the internal dm.Document
that afterPaste uses, and so the store index of the <b> annotation
that was not stripped would differ between the internal document
and the main document. This should have been resolved by remapping
the store indexes in the data before inserting it, but because
remapStoreIndexes() was broken this didn't happen, and the test failed.

Change-Id: I3c9a4f8417107bfcd208cb9333fbbd188e13bb80