Fixing most non-frontend-related compilation errors.

Need to tackle the frontend next, then the natives, and then I can start
testing.