Added usage of visitor pattern for more control of traversal for the new
compiler.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>