build: Endian compatibility

- Detect endian instead of stopping configure on big-endian
- Add `byteswap.h` and `endian.h` header for compatibility with
  Windows and other operating systems that don't come with them
- Update `crypto/common.h` functions to use compat
  endian header
src/hash.cpp: endian compatibility
src/main.cpp: endian compatibility in packet checksum check
src/net.cpp: endian compatibility in EndMessage
src/primitives/block.cpp: endian compatibility in GetHash
src/primitives/transaction.h: endian compatibility in serialization
src/script/script.h: endian compatibility for PUSHDATA sizes
src/serialize.h: base serialization level endianness neutrality

Serialization type-safety and endianness compatibility.
src/netbase.h: Fix endian in CNetAddr serialization

We've chosen to htons/ntohs explicitly on reading and writing
(I do not know why). But as READWRITE already does an endian swap
on big endian, this means the port number gets switched around,
which was what we were trying to avoid in the first place. So
to make this compatible, serialize it as FLATDATA.
src/arith_256.cpp: bigendian compatibility