Wells Fargo has agreed to a $3.7 billion settlement with the Consumer Financial Protection Bureau (CFPB).