Mock http with nock in tests

Switch from mocking `request` with `mock` to mocking the underlying HTTP requests with `nock`. Longer term this should make it easier to test against API response fixtures.