Optical properties of transition metal dichalcogenide monolayers, heterostructures and alloys