Feature #1145 Add group_by to simple_select

#1145; Adds group_by to the $db->simple_select database function. Also changes two simple queries with group by clauses to $db->simple_select