Spectral Variational Integrators