Factored HTML canvas backend into generic canvas backend.

This allows a platform to implement Canvas and have a whole graphics
implementation based on that. I was thinking this would be good for Flash, but
I forgot that Flash is really more like the old HTML DOM backend, in that it
keeps the Flash scene graph in sync with the PlayN scene graph. Whee!

This also adds two API bits: Canvas.clipRect() (previously it was only possible
to clip to an arbitrary shape), and Pattern.repeatX/Y, which ostensibly means
that Pattern can be made to only repeat in the X or Y direction (based on the
repeatX/Y configuration of the image from which Pattern was generated).

This latter feature is "spottily" implemented. HTML's canvas backend does it,
and I'll endeavor to make Surface on the GL backends do the right thing. But
the platform canvas implementations by and large lack the ability to fill with
a pattern that repeats only in X or Y. It's highly unlikely that anyone will
ever try to use this or care, it's just needed for the (also never used or
cared about) ability for an ImageLayer to have an image that repeats only in
one axis and is stretched in the other axis. I should probably just nix that
and have ImageLayer repeat in both directions or not at all.

This also makes CanvasSurface.drawLayer() work properly on the HTML Canvas
backend, because we now have a "free" way to render a scene graph to a canvas
on said backend.