Novel Soft Chemistry Synthesis of TiO2 for Applications in Dye–Sensitized Solar Cells and Photocatalysis