Fix Spark MapReduce to properly broadcast and use 'params' object