Batch subupdates caused by any state update

With this, multiple setState calls triggered by a componentDidUpdate handler (or similar) will be batched together, regardless of if the original setState call was in a batching context.

I also cleaned up some inconsistencies with the order of component updates and callbacks in situations where one component's update directly causes another to update.

Fixes #1147 and #983. Helps with #1353 and #1245 as well, though doesn't completely fix them yet.

Test Plan:
grunt test

Depends on #1362 and #1358.