Use real httpserver.HTTPRequest in WSGI apps instead of mock

A large amount of parsing code that the two classes had in common (duplicated, generally in constructors) has been refactored into utility functions so that only minimal logic is implemented. Also, some attributes that were previously set based on multiple conditions in constructors have become properties.