[sensor/battery] Implement the charging zone behaviour

Improve the associated test to check the 'charging zone' behaviour
[core] Add an helper in Object to know in which zone(s) an object is
[sensor/battery] Use the new Object.in_zones API

While here, fix some 'algorithmic' issues