Add function cogroup().

Could we move these two functions `initAccumulator` and `addItemToAccumulator` to a utils.R ? I think we should still be able to use them in `worker.R` as we load the SparkR package on the worker side as well.