Mesh simplification completed (but not tested).
More work on simplification (still broken).