Event logging and other improvements

This will let Servo dump a JSON log of the atoms it's interned, which can guide us on future changes to this library.

Event logging isn't actually that much code. The bulk of the PR is misc cleanups and improvements.  There's also a few new tests and a new benchmark suite.

Tests pass in Valgrind.
Did you look into the cause of the crash with previous code?