Formation of Color Centers in Lead Iodide Perovskites: Self-Trapping and Defects in the Bulk and Surfaces