Fix headers order to avoid compiler warnings.

Python-related headers must be first, otherwise there are warnings
about redefinitions of _POSIX_C_SOURCE and _XOPEN_SOURCE.
Fix instantiation order.

Avoid compiler warnings that class variables are initialized in a
different order than defined.
Remove trailing whitespace.

No change in code function.