Updated the render() function to run slightly faster

The `render()' function has been updated to used cached values for arrays, and the canvas element (the DOM is no longer asked to fetch the canvas and context each time render is called.)