Improved painting hierarchy

Previously each View maintained a Canvas and its own painting state. The
parent would copy the child's canvas into its own canvas buffer at the
correct coordinates, creating many memory duplications. In addition a
child maintained its own 'dirty' flag instead of notifying the parent
and each View had to be visited when repainting.

This has been replaced by a painting hierarchy where the parent tells
the child to paint into a particular rectangle inside the shared
terminal buffer. It also supports bubbling up the need to repaint, which
avoids visiting unchanged View subtrees.

Much of the shared logic has been refactored into the BaseView struct.
Views and Widgets are (anonymously) composed of BaseView and override
the PaintTo function if necessary.