added flatMap to the JsonCollection class

When doing nested data transformation om properties of the collection, it's most useful to use flatMap(f) instead of depending on the scala flatten implementation of the collection returned by function f