Big overhaul

Group by function only like in the text output (cleaner and simpler)
Same order of comumns than in the text output
Line numbers in their own column

Closes gh-2 and gh-3