Implement group_by Liquid filter & tests.

Supercedes #1738.