This isn't quite right. When the returned promise is resolved the user should be guaranteed that `layers` is set and that getOlLayerById and getBackgroundLayers can be called. It's not the case currently. To fix this I should return the promise returned by $http.jsonp().then() rather than that returned by $http.jsonp().