Fractals in JavaScript using HTML5 Canvas