Add pop-front function
Factor out endian-ness portability tools