Fixing bug with storingPower

I found a bug where if I supplied a redstone signal to the battery, on a network that had a surplus of power, it would continue charging the battery well over its maxPower value. I fixed that bug, and added caching so it doesn't have to check redstone signal levels every tick. This does disable charging the battery when it has a redstone signal though. If that behavior is desired, I can add in additional code to handle that.

* 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.