Added PHP Namespaces function, to prevent from conflicts
Corrected local IP address detection
Corrected XFF IP choice, see http://en.wikipedia.org/wiki/X-Forwarded-For#Format