Homogeneous route to polyaniline