Removed dependence on thread-local storage, introduced visitor context.
Some refactoring of visitor context.