Tracevis: allow composite tasks in waterfall to be collapsed

This change also includes some cleanup to the waterfall graph generator.

Feature requested by @yborovikov.