A Perturbation Theory for Hamilton's Principal Function: Applications to Boundary Value Problems.