Insights into Copper Sulfide Formation from Cu and S K edge XAS and DFT studies.