The photochemical mechanism of a B12-dependent photoreceptor protein