[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.
keeping g1 and g2 (since they're just constants) but changed q1 to q2 to more descriptive names. The expressions for q1  and q2 contains multiple references to g1 and g2. Longer names will make those two expressions really long.