completion class SCgTemplateMode and SCgTemplate

add deployment
add folding
add SCP code generation
fix bug with ghosts
fix move bug with ghost
completion of existing templates