Use #flat_map instead of #map{}.flatten

Using flat_map seems to have measurable performance gains over map.flatten.

Bit more info here: http://gistflow.com/posts/578-use-flat_map-instead-of-map-flatten