Optimization in Other
Refactor to move counters from view to model.
The model emits signals when the number of items change, but it did not
provide get methods to know that number of items, so the view had to
keep its own counters and update them when the model emitted the
signals. Get methods were added to the model and the counters were
removed from the view.