Resolve py2 grammar (alternative to #776) (#1090)

* Resolve use of Python 2 grammar + fix three related test cases

* Simplify ParseCodeToTree with identical semantics
3 files changed