Do inventory updates in batches.

This has to be refactored and must be moved to the node-client project.