Code moved from cview2.js to individual files under js/foam/graphics.