Move bindframe up to line 23 (under "var cachedParsedStack")?  I.e. keep list of variables near function to reset them.
Actually, that makes me think that the global variable approach may not be ideal.