Test infrastructure for scope completion

Which currently is broken in that it doesn't include
imports defined in the closest enclosing block.