change code to use list of input/output field pairs
Generated code directly access fields. Macro uses list of input/output pairs

This fixes a bug where the original code did not detect that there
was more than one input field that could map into an output field.