Added sorted() method to js, and snapshotting tool