Make use of XCHG/BSWAP on x86, REV16 and REV on ARMv6-m and above, and whatever other optimized instructions on other platforms. Defines extra CONFIG variables, and removes the unused functions for endian-swapping. Fixes some oversights in using the macros.