Move Expression::toCBuffer and helpers into hdrgen.c