Move Geo IP parsing to add ip_geo

If we have geo data, report ip_geo instead of ip, and move the
conditional block up in the loop.
Expand main regex with /x flag

Perl allows comments in regular expressions, so expand the main
line splitting regex and explain which part is what.
Parse user agent string.

Add optional user agent parsing code, similar to how the geo IP code is
structured.