Sort revisions

I believe that the sorting test cases all build correctly now. I changed some aspects of the model and view to ensure that it compiles.