Add optional Referer header to all requests; some whitespace cleanup