Address endian compile errors for OSX in the cases where sys/param.h was
include ahead of the predef headers. The solution was to: use the OSX
machine/endian.h header, and only allow a single OS to be detected at
once. Test cases added for both conditions on OSX.