Outputs code to file

Can give a file to output to, which is good since a lot of debugging
info is printed anyway.