Foundations of Carbon Accounting