Added scope-aware auto-complete for local/global variables (closes #291).