Add a basic logger and optimize the Mesh class.