added check for system endianness (using the endian header from boost) and converting from/to big endian as necessary, which should close #1