Refactored AST visitor function

Now all AST visitors return a length 2 vector, containing their type and
their information. The type is thrown away in certain contexts, but it
provides a uniform structure to the method.