More unit tests for TypePrinter. Using it in more places in generator.py.