Eliminate warnings in byte order inversion functionality by using unions. Add test case simulating conversion to big endian.