Add function countByValue() and countByKey().

This is a general comment and can left as a separate cleanup PR. I think it would be good to separate out these RDD functions that apply to pairs both in the codebase and in the documentation. 
In the code base we can just create pairRDD.R and put things there, but I'm not sure about documentation. Let me know if you have any ideas