fix #1053
much better handling of import aliases in completion
use proper name matching algorithm for aliases