Improve the scale of ordinal variables.

Before the order of items on the scale was just determined by how they
appeared in the data. Now, we calculate counts and sort the items
ascending. As a result, the categories with "chosen" by most items (lines)
will be at the top.
Reorder the dom elements as well on manual axis reordering.

When the order of axes actually has changed due to user ineraction,
we also want to reorder the actual dom elements that represent
the axes. That is, the g.dimension elements. If we don't do this,
we get a weird and confusing transition when updateAxes is called.
This is due to the fact that, initially the nth g.dimension element
represents the nth axis. However, after a manual reordering,
without reordering the dom elements, the nth dom elements no longer
necessarily represents the nth axis.