Use nock + request libraries, add more tests

Change-Id: Id78dc6ef5842f9e1e185e1ea50db301c26647996