Move print_ast into the translator

I haven't tested this commit yet, so it's probably at least somewhat
broken.