Controlled Electrochemical Reduction of Gold and Palladium Metal Precursors in Polyaniline