Got the sorting working.

I've got the basic working now, along with the sorting function.  The
next step, I think, is to implement the basic ArcGIS REST functionality
(maybe I can borrow some of this from MapSphere or the continuum
prototype?), so that real data can be used in testing the data handling
API.