Add warning when repaint is called recursively 

(e.g. within ```paint``` method). Also, a minor refactor of ```PaintManager.repaint```.