Converted repl output to format as valid HCL
Added scoping so that variables are declared at the top of each scope