Threads and events

This fixes a number of arithmetic bugs in the viewer, and extends functionality in various ways.

The two main extensions are:
  1. Overlaid plots of instantaneous events.  These may be derived from various sources e.g. syslog.
  2. Process bars are joined by per-thread bars, useful for study of activity inside heavily multi-threaded processes e.g. Firefox.  Requires matching extension of the collector.

I've rebased to as recent a commit on mainline as was possible with moderate effort.

Backward-compatibility with the bootchart.tgz format from standard distro collectors is preserved -- tested with Ubuntu.