Backport changes used in SparkR to 0.8 branch

Backports two changes from master branch

1. Adding collectPartition to JavaRDD and using it from Python as well
2. Making broadcast id public.