determine recencey based on data, not clock

I changed the code slightly so it'll return recency based on clock if no data is available:

```
-    now_timestamp := max(end_timestamp) from document_hits;
+    now_timestamp := COALESCE(MAX(end_timestamp), NOW()) FROM document_hits;
```

That fixed the test that was broken https://travis-ci.org/Connexions/cnx-archive/builds/14392216
and I added another test.