Rename a bunch of macros, change a lot of generated code to macros