Refactor httpInterceptor adding $locate service and unit test.

Related to the issue
https://github.com/seriema/angular-apimock/issues/2