Use the first IP in the list from X-Forwarded-For

fixes #647

This works in the case of only a single IP address and with a list like "99.100.2.45, 10.10.2.5, 10.10.2.4". I have also added tests to reflect this change.

This could still be improved more by using the first public IP address rather than just the first in the list. Ben, if you think that Tornado should handle that case then I can extend this more.