The social media giant also agreed to make sweeping changes to Instagram and Facebook.