Cleanup of byte-swapping macros.

Standardise on <endian.h> macros, provide compat if necessary.