A 55-year-old woman comes to the physician because of recurrent chest pain over the past 3 years. These episodes are not related to activity or exertion. She has the sensation that food gets stuck in her chest. She has occasional nocturnal coughs and regurgitation. A chest X-ray during an episode shows widened mediastinum. There are no other bowel problems and no abdominal pain She is given a trial of proton pump inhibitors (PPI) but there is no relief. 

Which of the following is the best test to confirm the diagnosis of the underlying disease?
Barium swallow study
CT scan of thorax with biopsy
Endoscopy with biopsy
Esophageal motility study