Add/rearrange some headers to make the style checker stop complaining. Fixes #2686. Fixes #2687.

Reviewed by Daniel Mewes.