Moved the Spirit stuff out of main to speed up compilation times.