As it struggled, A123 showered Democrats with donations, hired pricey lobbyist