After years spent cast as the underbelly of the global economy, mining is undergoing a reputational and financial revival.