trace_to_text: Refactor in preparation of userspace events json export

Extracts json export out of TraceToSystrace, so that we can add export
of userspace events in a follow-up patch.

Bug: 142222891
Change-Id: Ib75271f72a7712b00e93c2fcf76311da3f5cd070
diff --git a/BUILD b/BUILD
index a0229d6..6267365 100644
--- a/BUILD
+++ b/BUILD
@@ -988,6 +988,8 @@
         "tools/trace_to_text/main.cc",
         "tools/trace_to_text/symbolize_profile.cc",
         "tools/trace_to_text/symbolize_profile.h",
+        "tools/trace_to_text/trace_to_json.cc",
+        "tools/trace_to_text/trace_to_json.h",
         "tools/trace_to_text/trace_to_profile.cc",
         "tools/trace_to_text/trace_to_profile.h",
         "tools/trace_to_text/trace_to_systrace.cc",