Replace mapValues with one single map to avoid serialization in frameworks like Spark.
Merge pull request #344 from lvicentesanchez/develop

Replace mapValues with one single map to avoid serialization in frameworks like Spark.