Ion Transfer Dynamics of Polyaniline and Its Derivatives in Energy Storage and Water Purification