[Refactoring] Reduce uninitialize local variables
[Refactoring] Reduce indent level in loops
[Refactoring] Remove unnecessary SCOPEfree flag handling

It's properly handled in `Scope::alloc`.
Merge pull request #3944 from 9rnsr/refactor_scope

[Refactoring] scope.c
[Refactoring] TemplateInstance::semantic()

- Remove a goto jump
- Reduce code indent level
- Use ModToStc in TemplateThisParameter resolution
[Refactoring] Add Module::rootImports() and use it in TemplateInstance::needsCodegen()

it would make compilation a little faster so `rootImports` cache the result.