Refactor GeoIP lookup code; add tests

* Break up some code into discrete functions:
  * geo_set_cache_control: sets Last-Modified & Cache-Control headers.
  * geo_get_xff_ip: gets an IP address from the XFF header.
* Rename getaddrfamily -> geo_get_addr_family, for consistency.
* Replace TIM_format(TIM_real(), date) with VRT_time_string(sp, VRT_r_now(sp)).
* Send 'Geo = {IPv6: true}' if client IP was IPv6.
* Remove the silly, hard-coded netmask attribute. It is not in use.
* Add unit tests.

A follow-up change, Ic4d2fccbc, adds code for sending GeoIP data via a cookie.

Change-Id: I26af69dc01daf9bda7d463c07500d16c0043fd3a