First-Principles Exploration of the Structural Motifs of Chalcogenides and Their Relationship to Electronic and Photovoltaic Properties