refractored jsPrinter for using SourceWriter