X-Forwarded-For, fixes, small cleanup, and X-Real-IP

- There is a pretty major fix in this pull request here 1e9f8cb. The headers were not being retrieved properly from `$_SERVER`.
- Small formatting fixes here 43a8e0a, missed from previous pull request.
- **X-Forwarded-For** has become a de facto standard header for proxies, added by 661e163.
- **X-Real-IP** is not really a de facto standard, but is used by lighthttpd and nginx, which are very common proxy servers, added by d6fd6d0.