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.
Ensure we're backwards compatible for 2.5
Merge pull request #137 from dpnova/feature/unittesting

Unit tests for the core HTTPRequest class.