A Photo- and Redox-Driven Two-Directional Terthiazole-Based Switch: A Combined Experimental and Computational Investigation