Also, what do you think about making this `if (!(ret in GROUP_ORDER))` instead of `if (HEADER_LETTERS.indexOf(ret) < 0)`?

It would be nice to avoid scanning an array every time.