Moved some general code from MonotonePiecesPainter to TransformingAlgorithmPainter
Updated comment boilerplate
Removed trailing whitespace