Fixed the ordering by reusing only the NodeKey objects of a single node (and not using a static map)
Also use a custom comparator for the node values. This gives the advantage of clearing out duplicate tag-value/xref lines when printing with the text or HTML printer. Structure lines are always unique and the tag line uniqueness is defined by its value/xref