Tidy all code files

This is rather huge.

I don't know if now is the right time to tidy, since it will make merging a lot of outstanding patches much harder.

But the longer we go without tidying, the worse its going to get.