Add warning when repaint is called recursively (e.g. within paint method), with minor refactor of PaintManager.repaint.