Fixing bug with storingPower

* Renamed the variable to make semantics match usage.
* Caching the state of storingPower and updating on block update.
* Fixing logic to correctly return power to the network without
overflowing the battery if the network has a surplus.