Further reorganization of simple.viewer to support both 3d and 2d