Modeling polarons in density functional theory: lessons learned from TiO2