Issue 171 5a

These patches do mainly two things.
(1) Add endian conversion code.
(2) Prepare for sending triggers data.
BTW glib has a pretty macro "G_BYTE_ORDER".
It would be better to introduce such mechanism instead of checking CPU architecture directly.