"Constant time" symbol table

Actually, it's O(definitions in topmost scope) upon leaving a scope,
since each reference in the index has to be set to its previous
definition, so I'm not sure if this is to ever outperform the old
version on realistic inputs, but it should be better at handling deep nesting.
Unnecessary parens and curly braces (the inner ones). You could also merge the two pattern matches.