javascript implementation of Mandelbrot