[SPARK-983] Support external sorting

This satisfies SPARK-983 Support external sorting for RDD#sortByKey()
It also adds a general sortPartitions() method to RDD.
If we use the same parameter for sorting, it might make sense to call this something else, since this isn't exactly a shuffle.