implement scoping symbol table

Implements the scoping strategy for variables discussed in #60.

`new_scope` will be called prior to passing the symbol table into the scope.
`pop_scope` is used when we return symbol table from the scope. It is necessary to perform this step so that we retain any changes to the other scopes.