Amazon Lays Off Thousands Amid Shift to Cloud Computing