Viewer grid

This implements the grid for the 3d viewer as required by #41, and also does a bit of restructuring to pave the way for more flexible views and hopefully tools/manipulators at some point.

Note that this does change the API for Gadgets a little - let me know if it impacts existing code and I'll provide backwards compatibility somehow. The only change I think is likely to be a problem is  ViewportGadget setChild()/getChild() being replaced with setPrimaryChild()/getPrimaryChild(), but since the only custom views I know of derive from existing views, I doubt they actually call setChild() anyway.