Add support for big-endian machines.

The basic idea is that the structs are little-endian, but if you compile
this on a big-endian machine, it will take care of the conversion. Currently
this is linux-specific, later I can add some code to handle *bsd and the
like.