Add CerealUtil.writeHeaderWithImports and refactor CerealDecoderTest to use it.