Move some globals into objects (still global), fix cutoff/fuzzy lines. Download buffer canvas instead of visible canvas, thus giving full image not only viewport. Make display result work again.