Generate blocks with the gen string interpolator

A subclass of CodegenHelper, contained in GenericNestedCodegen
detects whether to print to the stream or simply call emitBlock.

Stripping the margin becomes more complicated as the context part may
contain a |.
Change .check files so the gen code looks better

'emitBlock' prints a new line at the end of the block, so a blank line
is currently generated after every block.  To avoid this one could
remove the new line in the string interpolation, but that's ugly.