Split out functionality like https://github.com/mapbox/assert-http/pull/11/files into individual functions so that they can be unit tested without much overhead.