Cleanup of proposed TraceSystem API and addition of tests for it.