Make the panel icon dynamic

With UPower < .99 this patch will make the battery panel icon
dynamic by displaying the ups or battery device with the highest
percentage. This patch also cleans up a couple small issues with
the last two patches (unused function and variable).