Allow compilation with apache 2.2 and apache 2.4

This adds a macro to get the remote IP address from the right place in
the struct
Remove unused code

This removes some unused varibles and a function