[buffer] private struct, writing, machine byteswap

Don't show chckBuffer to public in header file.
Provide chckWrite functions.
Provide functions similar to C IO interface.
Use more optimized byteswap, if available
Rename chckFlipEndian -> chckBufferSwap
Make chckBufferIsBigEndian public
Add tests for new stuff