Layered Perovskites in Solar Cells: Structure, Optoelectronic Properties, and Device Design