avoid setting multiple endianness and to avoid including extra headers. Addition of some documentation to endian detection.