Request parser tests and minor refactoring.