Javascript add / remove collection element - refactored and working on charge_cycles.