add middleware to record all page visits.

In the future it might be better to move this out of the database
to an external log store, but for now it will do.
Fixes #47