Localised all variables in Template

If a variable is global , any other lua script can access it (as long as
the file with the variable in was initialised before the file accessing
the variable). The template now has all it's variables localised.