seperate JSScope and update for new Tree interfaces