Performance and readability

Massive graphics boost by only redrawing the frame after processing the
last scan line and NOT on every horizontal blanking period. Also
includes some readability improvements in the code.