Move endian-ness tools into buffer area
Remove non-portable error handler
Use portable ntohl