(PUP-3718) Make defined function handle qualified variable names
The defined function can answer if a variable is defined. There
were however no tests for qualified variable names. The implementation,
when given a qualified name simply tried to lookup the complete name
in its own scope which naturally failed.
This commit adds logic to check if a variable is qualified in the
Scope#exist? method, and then mimics the behavior of a variable
lookup by splitting the name, then looking up the class and its scope
and finally delegating the exist? call to that scope.
This is made somewhat complicated when testing due to the fact how
scopes are wired (to find other names scopes). The test that checks for
the existence of a top scope variable now sets this up as if the main
class (called '') had been evaluated.