Add alternative for __builtin_bswap{32,64}

Functions __builtin_bswap32 and __builtin_bswap64 are only present on
GNU compiler 4.3. Building with older or different compiler was not
possible.

Please review this PR carefully, I'm not entirely sure if reinterpret_cast()
does the same as the union. I noticed that there's a test for serialization,
it passed but is a very simple one.