"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.
`.flatMap(_.defs.get(name)).map(_._1)`? (in this particular case, I actually prefer explicit tuple access)