Refactored code so that lookup returns a list of resolved names.
Added ambiguity handling to exportstack