added support for x-forwarded-for logging, better ping method, and other small improvements.