Eliminate loop over ops in Context.nextOpId()
Eliminate loop over ops in Context.nextOpId()

We have a use case where we need to copy large documents, containing
as many as ~100k objects nested in various ways. This was painfully
slow, and profiling revealed that we were spending a lot of time in
Context.nextOpId(). This change tracks nextOpNum as a property on the
context, and updates it in addOp() when new ops are pushed.

The change here drastically speeds things up for us: after this, copying
is still a little slow, but the situation is much improved, and the
bottleneck has moved from generating the op list to applying it.

The new strategy should be functionally equivalent to the old one, and
this change passes tests (at least when I run them), but I very well may
have missed something, so feedback is welcome!

automerge/automerge,automerge/automerge