rewrite codegen to support multiple languages
fix tests accordingly