Ab-initio study of the electronic states and structure of Polyaniline polymers