code: function(ctx)
  {
     // sort keys
     var rval = {};
     var keys = Object.keys(ctx).sort();
     for(var k in keys)
     {
        var key = keys[k];
        rval[key] = ctx[key];
     }
     return rval;
  }
docs: Sorts the keys in a context.
  
  @param ctx the context to sort.
  
  @return the sorted context.