battery remaining extension causes conflicts with other extensions

It appears that this extension is conflicting with the GPaste extension, and possibly others. See the following bug from GPaste https://github.com/Keruspe/GPaste/issues/51

After investigating, I found that if the batteryBox has not been created when hideBattery() or showBattery() is called, matching Main.panel.statusArea['batteryBox'] to Main.panel._rightBox.get_children()[i]._delegate will succeed for every extension. I've moved the call to the _replaceIconWithBox() call to come before the hideBattery() and showBattery() calls. I've also added a check to each of those functions to ensure that Main.panel.statusArea['batteryBox'] is not undefined before comparing to the _delegate property.