added a (fairly sound) to_pairs function for mcReduce