Add some unit tests for the ParsedHttpRequest class; refartoring