Magnetic and electronic properties of 2D TiX3 (X = F, Cl, Br and I).