Media-buying agencies are trying to modernize their business to meet the demands of a data-driven advertising world.