Amazon agrees to purchase MGM for $8.45 billion