Interpreter class reference nodes: check for JS globals

This is a fix for #654.

There seems to another issue with `Interpreter`: if a variable is `nil`, interpreter returns an object. I added a test case.