utils: added leftover() and an endian test for bit_coder.