Forgot to mention that I moved all tests into their own function in main.cpp. Main can now take a filename to store PostScript code into.