Boundary Conditions as Dirac Constraints