Remove bad css classes from buckets

Once a bucket received a lower or an upper css class, it was never removed.

Once an update function is done, than the bucket with an index of last one - 2
will automatically receive a lower css class because that is the definition
of the isLower function.

The heatmap plugin reuses the already existing buckets and only adds new
ones if neeeded. So after new buckets are added a new one with will get
the lower css class, but nobody removes the lower class from the bucket
which already had it.
Update the tab builder to use fewer iterations

Previously the heatmap tab builder iterates over every tab for each
style that is applied. Now we only perform the iteration once and
apply all updates together.
Add unit tests for the heatmap tabs rendering
Merge pull request #1662 from hypothesis/1620-multiple-down-arrows-tweaks

Tweaks to Remove bad css classes from buckets