Cardinals, Wainwright agree to $97.5 million extension through ’18