ENH/CLN: track scope instead of hard coding minimal stack level
ERR/API: disallow local references in top-level calls to eval
BUG: ChainMap m parameter only exists in Python 3.4

So backport that as well.
BUG: use a regular for loop in _ensure_term

In Python 3.x list comprehension build up stack frames, thus providing the
stack level to search is not the same as it is in Python 2.x.