Sweeping changes to the headers

Most changes are just whitespace/#include cleanups; there are very few
logic changes.