Some cleanup, comments, etc.
Change logging format, log requesting user-agent