I'll eventually move the utils into a different location (maybe CCAN?) but for now I'm keeping it close to where it is used.