Batch updates caused by handlers in multiple roots

Fixes #1227.

It seems rare that event handlers in two roots nested in the DOM will update the same component in the same tick, but if that happens, the updates should be batched together.