Time & Duration refactor.

- Rename `TPTime` type to `time`.
- Rename `TPDuration` type to `duration`.
- Remove `TPTimestamp` type (in favour of `time`).
- Brand `time` type.
- Add `Time` and `Duration` static classes for functions that operate on
  time and duration types.
- Remove free functions like `toNs` and `fromNs`.

Change-Id: I7651b97e44ded76d23fe2f566da10690e80c47be
diff --git a/ui/src/controller/aggregation/counter_aggregation_controller.ts b/ui/src/controller/aggregation/counter_aggregation_controller.ts
index e632f8e..41a47fe 100644
--- a/ui/src/controller/aggregation/counter_aggregation_controller.ts
+++ b/ui/src/controller/aggregation/counter_aggregation_controller.ts
@@ -15,7 +15,7 @@
 import {ColumnDef} from '../../common/aggregation_data';
 import {Engine} from '../../common/engine';
 import {Area, Sorting} from '../../common/state';
-import {tpDurationToSeconds} from '../../common/time';
+import {Duration} from '../../common/time';
 import {globals} from '../../frontend/globals';
 import {Config, COUNTER_TRACK_KIND} from '../../tracks/counter';
 
@@ -39,7 +39,7 @@
     }
     if (ids.length === 0) return false;
     const duration = area.end - area.start;
-    const durationSec = tpDurationToSeconds(duration);
+    const durationSec = Duration.toSeconds(duration);
 
     const query = `create view ${this.kind} as select
     name,