new version using only traceback and no ast parsing.

increases robustness, decreases complexity.