Context and transformers work - 2

Continued from #1100.

Not ready for merge -- opened to ask questions on the code and get some reviews/feedback.
yes, here. Maybe make these fields be on the visitor itself, then make getters for them?