Fix some visitor bugs, add pretty printing for ASTs (--print-ast)