SERVER-8632: fix server-side JS for MapReduce, $where and group