Sort RDF statements topologically.

Sort statements in order to generate good RDF/XML, to take
advantage of attributes and striping.
Deal with LiteralImpl having null datatypes in older Sesames.
Some refactoring for null-first comparison.
Use RDFTripleTopologicalSorter when transforming Simple to RDF.
Sort RDF topologically to improve output.