Issue #2308455: Slight refactoring of visitor context code and the beginnings of qunit tests