Reworked batched write API to use beginWriteBatch/commitWriteBatch:.