Fix header includes

This makes sure all headers are self-contained (i.e., they include all header files that contain the used definitions).