Full battery.h rewrite