WIP: Added functionality to sort (some) dictionaries.

This needs some more testing and a little cleaning up, but it should be in pretty good shape.

Ref: https://groups.google.com/d/topic/julia-users/e1Pk6rjh6Ao/discussion (although it's not entirely relevant)