Added code for visitor pattern, fixed compile issues.

This can be local to the NLP controller component.