Refactor httpparser

Adds some assertions and comments to the test file to let people know what's going on.