[SPARK-2082] stratified sampling in PairRDDFunctions that guarantees exact sample size

Implemented stratified sampling that guarantees exact sample size using ScaRSR with two passes over the RDD for sampling without replacement and three passes for sampling with replacement.
The first sentence should provide a summary and the following paragraph should expand this first sentence if some terms there are not well-defined, e.g., `sample by key` in this case.