Sort button groups with mongo rather than post-sorting in JS.