This patch replaces the old structure with an abstract base-class, which the new ShadingPattern classes then inherit from. The old `createMeshCanvasClosure` can now be removed, since it's not necessary any more with modern JavaScript, and the `createMeshCanvas` function is now instead a method on the new `MeshShadingPattern` class (avoids unnecessary parameter passing).