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.

Tests pass in Valgrind.