Implement uniqueSort

This method is useful for code that needs to operate based on the
document order of the generated nodes.
Merge pull request #8 from jugglinmike/unique-sort

Implement uniqueSort