Unit tests for the core HTTPRequest class.

There's a bit of edge case behaviour with dealing with IPs that
is currently untested, but this shouldnt be a big issue.