Graphing and function plotting for the HTML5 canvas