fix value mutation in sort and groupBy filters

The filters groupBy and sort (when used on lists) are mutating the values that they are being applied to. This is probably unintentional, since it is easier to reason about what is going on in a template if filters don't have lasting side effects outside of a specific filter chain. Some noticeable effects of the mutation are:
  1. items in lists run through groupBy will permanently lose their original key
  2. groupBy can't be used twice in the same template
  3. the original order of a list will be lost when the sort filter is applied to it