Photoelectrochemical and Electrocatalytic Behaviors of TiO2 Nanostructures and TiO2−Au Nanocomposites: Effect of Synthesis Conditions