viewer: pass reference instead of pointer.
viewer: use MeshTools::compile().

Makes the stuff simpler.