Move helpers into lib.
Add helpers requires.
Add groupable_columns method.
Symbolize sort_criteria and fix sortable/group_by sql.