Update Logger to handle empty referer field

Currently a warning is written to the web server log if the logger tries
to access the HTTP_REFERER index on $_SERVER and it's not present (e.g.
when a user refreshes or comes to the page from a bookmark).  This fix
checks first to make sure the referer is set.
Merge branch '8w-add-logger-tokens' into live