HPCC-12408 Various code generator optimizations

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
ok, there is an (or more) example(s) above that have no newline etc (superficial comment)