Use httptest instead of a bunch of nonsense.

I even read about this thing but only saw the bit about the client and not the server. Woops. @bdehamer @alexwelch