Sort index

Previously, when an element was inserted into the index, the key order
was insertion order.  This made it difficult to scan to determine
which versions of the JRE were available.  This change ensures that
the index is sorted lexically by key when before it is written.
Merge branch 'sort-index'