Remove unneeded comments in test.
Refactor apiMock._isLocalMock.
Refactor so local and globalMock use same logic.