Move battery reporting into common Node code.