Use <endian.h> for byte order helpers

Also add missing helper functions.

Signed-off-by: Pekka Enberg <penberg@kernel.org>