[WIP] Test infrastructure for code generation

See #159 
See single commit for details
Depends on #154