Scenegraph optimizations

Scenegraph is pretty snappy now, although there are plenty of opportunities left to optimize. Major changes:

* Added `TransformCache` class, which allows `ChainTransform` instances to be re-used across frames. This prevents most of the program recompiling.
* Canvas gets `ndc`, `framebuffer`, and `pixels` entities that are used to represent the coordinate systems it handles.
* Avoid generating throw-away `Variable` instances in `Function.__setitem__`. This was wasting a lot of time.

There is still some cleanup left to do, but once this is merged I think we finally have a usable scenegraph.
It's semi-public because we might want to change their names in the near future :)
We have about several different names covering these three coordinate systems: ndc, framebuffer, pixel, logical pixel, physical pixel, device pixel, document, canvas. Need to cull that list down and be more consistent..