Conformal Field Theory, Boundary Conditions and Applications to String Theory