Added a Scala port of MRUtils.