Cleanup implementation and validation of codegen targets

Fixes #63