Debug: Move static def generating code into a function.
Debug: Move static def generating code into a function.

Fixes #136

arruda/pymclevel,arruda/pymclevel,mcedit/pymclevel,mcedit/pymclevel,ahh2131/mchisel,ahh2131/mchisel