docstring fix + minor cleanup
moved collect_variables (more logical order)
not all kinds contexts support the "extra" kw argument
split test line (easier to debug) / comment dump test
crude conversion of link functions to FunctionExpr, (seems to) work(s) but needs cleanup