Switch to custom byte swapping function.

GCC builtins like __bswap_32 are not portable between versions.
I'd like to see an explicit `assert(CHAR_BIT == 8)` or `assert(sizeof(uint32_t) == 4)` - they're equivalent, here - even though they are a *totally* fair assumption - the assert is how we document this ...