Collective interactions in Metamaterials and Cold Atomic Gases: Manipulating Light in Ensembles of Electromagnetic Emitters