Split CG-FUNCTION-FORM into smaller functions.
Split CG-FUNCTION-FORM into smaller functions.

rvedam/Mezzano,AugustusHuang/Mezzano,varjagg/Mezzano,froggey/Mezzano,varjagg/Mezzano,rvedam/Mezzano,froggey/Mezzano,AugustusHuang/Mezzano