Add total coverage to output

Also some documentation and code cleanup