Moved AST printing to main function.

This puts all the "weird temporary" stuff in main() where it belongs.