Implemented ability to sort a collection. Fixes #9