Fix constructor type in ast
Move print function out to its own file