Split off common definitions to header files.

We'll soon want to start using the profinet structures in other
applications, so move the definitions to a separate header file.
While we're at it also split off the debug code we might want to use as
well.