Add buffering and flush to PersistentMap