Fixed bugs
Added 'sort' and 'by'

Also some aggregate functions