Drawing a Mandelbrot with JavaScript on Canvas