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.
Nope, I just know it was caused by 724232d1b1c40fd44501c33024f840b033f816fb.