Context and transformers work - 2

Continued from #1100.

Not ready for merge -- opened to ask questions on the code and get some reviews/feedback.
Actually, this visitor doesn't need `Definition`, `Context` or any other state. Apparently I added the arguments by mistake.