Expose code builder on generator result, and some tidying up

var