Register a tab visit only after 500ms without timers.

Continuation of #1249.

Instead of using timers, this switches to calculating the difference in time between each call of the `chrome.tabs.onActivated`/`chrome.tabs.onRemoved` listeners. This has a couple of advantages:

* we're not relying on `setTimeout`, which is notorious for being inconsistent with how long it actually takes to fire.
* the code path is more linear, since everything is done as part of a callback from one of `chrome.tabs.onActivated`/`onRemoved`/`onReplaced`.

This also changes how we test it:
* we have to modify `TabRecency.lastVisitedTime` after each `TabRecency.add` to ensure enough time has elapsed. (Although I guess we could stub the `Date` constructor?)
* we can now (though I haven't) add tests checking that tabs not visited for enough time are not registered, something that wasn't possible before.