Big change to the way of creating panes.

Now it is far more general! Still need to implement averaging
(involving reduction in precision for speed).