Optical spectroscopy and resonance Raman scattering of polyaniline during electrochemical oxidation and reduction