Moved PrintLibrary code out of awkward before-main constructs