[Gravity] Fixed grouping implementation to consider HAVING and ON
Implemented functions (start|end)_(where|having|on)_group for MySQL and SQLite3