Integrating power measurements. I don't think it works yet, but at least
it compiles. Will have to write unit tests next.