Changed internal representation of sort

`sort` will now store its values in a nice, sane format. (using objects
instead of arrays)