WIP on ERP code generation. Taking this slowly and carefully to make sure I get the design right this time.