Initial draft of a tracing API.

This is used in conjunction with a collection & analysis server
to analyze memory usage and other aspects of a program running
under emscripten.