The insurance giant has agreed to a plan to repay the $182 billion bailout.