[ui] Tweaked plugin API and added more functionality to timeline API.

- Merge `Viewer` into `PluginContext` and `PluginContextTrace`.
- Re-jig naming conventions.
- Add extra methods to control the timeline.

Change-Id: I780c00a824c205fdd32441313a9c6c47f7c83664
diff --git a/ui/src/frontend/query_result_tab.ts b/ui/src/frontend/query_result_tab.ts
index c6b40b6..f0efe26 100644
--- a/ui/src/frontend/query_result_tab.ts
+++ b/ui/src/frontend/query_result_tab.ts
@@ -34,6 +34,7 @@
   closeTab,
   NewBottomTabArgs,
 } from './bottom_tab';
+import {globals} from './globals';
 import {QueryTable} from './query_table';
 
 export function runQueryInNewTab(query: string, title: string, tag?: string) {
@@ -47,6 +48,8 @@
   });
 }
 
+globals.registerOpenQueryHandler(runQueryInNewTab);
+
 interface QueryResultTabConfig {
   readonly query: string;
   readonly title: string;