Tiled Gallery: Extracted Grouper logic to files.

Extracted the Grouper that is used by the mosaic layout to separate files, as well as the now shared Jetpack_Tiled_Gallery_Item, which is also used by the square layout.