Refactors the code to be able to run with offscreen canvas.
However, I see no difference from running with one canvas or the other. The regular canvas may be even better than the offscreen one.